Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Unified Diff: ios/chrome/browser/memory/memory_metrics.cc

Issue 1544743002: Switch to standard integer types in ios/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/memory/memory_metrics.cc
diff --git a/ios/chrome/browser/memory/memory_metrics.cc b/ios/chrome/browser/memory/memory_metrics.cc
index 360c533f396221b3f8b5d072599a09895d2a625a..8ce4d9154d20289bccf60573a7324f0b71f7d467 100644
--- a/ios/chrome/browser/memory/memory_metrics.cc
+++ b/ios/chrome/browser/memory/memory_metrics.cc
@@ -5,10 +5,13 @@
#include "ios/chrome/browser/memory/memory_metrics.h"
#include <mach/mach.h>
+#include <stddef.h>
+#include <stdint.h>
#include "base/logging.h"
#include "base/process/process_handle.h"
#include "base/process/process_metrics.h"
+#include "build/build_config.h"
#ifdef ARCH_CPU_64_BITS
#define cr_vm_region vm_region_64
@@ -27,7 +30,7 @@ const uint64_t kVMPageSize = 4096;
namespace memory_util {
-uint64 GetFreePhysicalBytes() {
+uint64_t GetFreePhysicalBytes() {
vm_statistics_data_t vmstat;
mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
kern_return_t result =
@@ -40,14 +43,14 @@ uint64 GetFreePhysicalBytes() {
return vmstat.free_count * kVMPageSize;
}
-uint64 GetRealMemoryUsedInBytes() {
+uint64_t GetRealMemoryUsedInBytes() {
base::ProcessHandle process_handle = base::GetCurrentProcessHandle();
scoped_ptr<base::ProcessMetrics> process_metrics(
base::ProcessMetrics::CreateProcessMetrics(process_handle));
- return static_cast<uint64>(process_metrics->GetWorkingSetSize());
+ return static_cast<uint64_t>(process_metrics->GetWorkingSetSize());
}
-uint64 GetDirtyVMBytes() {
+uint64_t GetDirtyVMBytes() {
// Iterate over all VM regions and sum their dirty pages.
unsigned int total_dirty_pages = 0;
vm_size_t vm_size = 0;
@@ -72,7 +75,7 @@ uint64 GetDirtyVMBytes() {
return total_dirty_pages * kVMPageSize;
}
-uint64 GetInternalVMBytes() {
+uint64_t GetInternalVMBytes() {
task_vm_info_data_t task_vm_info;
mach_msg_type_number_t count = TASK_VM_INFO_COUNT;
kern_return_t result =
@@ -83,7 +86,7 @@ uint64 GetInternalVMBytes() {
return 0;
}
- return static_cast<uint64>(task_vm_info.internal);
+ return static_cast<uint64_t>(task_vm_info.internal);
}
} // namespace memory_util
« no previous file with comments | « ios/chrome/browser/memory/memory_metrics.h ('k') | ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698