| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/android/library_loader/library_prefetcher.h" | 5 #include "base/android/library_loader/library_prefetcher.h" |
| 6 | 6 |
| 7 #include <stddef.h> |
| 7 #include <sys/mman.h> | 8 #include <sys/mman.h> |
| 8 #include <sys/resource.h> | 9 #include <sys/resource.h> |
| 9 #include <sys/wait.h> | 10 #include <sys/wait.h> |
| 10 #include <unistd.h> | 11 #include <unistd.h> |
| 11 #include <algorithm> | 12 #include <algorithm> |
| 12 #include <utility> | 13 #include <utility> |
| 13 #include <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/metrics/histogram_macros.h" | 17 #include "base/metrics/histogram_macros.h" |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 std::count_if(is_page_resident.begin(), is_page_resident.end(), | 193 std::count_if(is_page_resident.begin(), is_page_resident.end(), |
| 193 [](unsigned char x) { return x & 1; }); | 194 [](unsigned char x) { return x & 1; }); |
| 194 } | 195 } |
| 195 if (total_pages == 0) | 196 if (total_pages == 0) |
| 196 return -1; | 197 return -1; |
| 197 return static_cast<int>((100 * resident_pages) / total_pages); | 198 return static_cast<int>((100 * resident_pages) / total_pages); |
| 198 } | 199 } |
| 199 | 200 |
| 200 } // namespace android | 201 } // namespace android |
| 201 } // namespace base | 202 } // namespace base |
| OLD | NEW |