From 0bfc8aca7edce0cf4ebc8406ccd257590815ea87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Wed, 2 Jun 2021 00:06:14 +0200 Subject: Fix build error for macOS arm64 on x86_64 When building for arm64 on an x86_64 macOS, the header files for the arm platform will be included, but ARCH_CPU_AR_64 is not defined. This lead to checking non-constexpr vm_page_size in a static_assert even though a DCHECK should be used for arm64. Use the DCHECK unconditionally on macOS builds to fix this. Change-Id: Iffa7e2de76358d3bb26473226e1c2a1ef6e0c356 Reviewed-by: Allan Sandfeld Jensen --- chromium/base/process/process_metrics_mac.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chromium/base/process/process_metrics_mac.cc b/chromium/base/process/process_metrics_mac.cc index fb9141463c5..4400ecebfe7 100644 --- a/chromium/base/process/process_metrics_mac.cc +++ b/chromium/base/process/process_metrics_mac.cc @@ -296,12 +296,8 @@ bool GetSystemMemoryInfo(SystemMemoryInfoKB* meminfo) { } 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, 0u) << "Invalid page size"; -#else - static_assert(PAGE_SIZE % 1024 == 0, "Invalid page size"); -#endif + meminfo->free = saturated_cast( PAGE_SIZE / 1024 * (vm_info.free_count - vm_info.speculative_count)); meminfo->speculative = -- cgit v1.2.1