Commit 2da39d93 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac/arm: Get process_metrics_mac.cc to compile

Bug: 1098899
Change-Id: Iae357fc998a662ed23bf1496a4ec21a12593f2cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2285331
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786042}
parent 332ffb68
...@@ -22,13 +22,14 @@ ...@@ -22,13 +22,14 @@
#include "base/numerics/safe_math.h" #include "base/numerics/safe_math.h"
#include "base/process/process_metrics_iocounters.h" #include "base/process/process_metrics_iocounters.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "build/build_config.h"
namespace { namespace {
// This is a standin for the private pm_task_energy_data_t struct. // This is a standin for the private pm_task_energy_data_t struct.
struct OpaquePMTaskEnergyData { struct OpaquePMTaskEnergyData {
// Empirical size of the private struct. // Empirical size of the private struct.
uint8_t data[384]; uint8_t data[408];
}; };
// Sample everything but network usage, since fetching network // Sample everything but network usage, since fetching network
...@@ -300,7 +301,12 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { ...@@ -300,7 +301,12 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) {
} }
DCHECK_EQ(HOST_VM_INFO64_COUNT, count); DCHECK_EQ(HOST_VM_INFO64_COUNT, count);
#if defined(ARCH_CPU_ARM64)
// PAGE_SIZE is vm_page_size on arm, which isn't constexpr.
DCHECK_EQ(PAGE_SIZE % 1024, 0) << "Invalid page size";
#else
static_assert(PAGE_SIZE % 1024 == 0, "Invalid page size"); static_assert(PAGE_SIZE % 1024 == 0, "Invalid page size");
#endif
meminfo->free = saturated_cast<int>( meminfo->free = saturated_cast<int>(
PAGE_SIZE / 1024 * (vm_info.free_count - vm_info.speculative_count)); PAGE_SIZE / 1024 * (vm_info.free_count - vm_info.speculative_count));
meminfo->speculative = meminfo->speculative =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment