diff options
author | Michael BrĂ¼ning <michael.bruning@qt.io> | 2021-06-02 00:06:14 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-04 10:20:30 +0200 |
commit | 0bfc8aca7edce0cf4ebc8406ccd257590815ea87 (patch) | |
tree | ea2d8ff1d833c718d32195442164941e6ef2ce5b | |
parent | 447c56bfa8bdbb75a89551bfb537d8a80ae10094 (diff) | |
download | qtwebengine-chromium-0bfc8aca7edce0cf4ebc8406ccd257590815ea87.tar.gz |
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 <allan.jensen@qt.io>
-rw-r--r-- | chromium/base/process/process_metrics_mac.cc | 6 |
1 files changed, 1 insertions, 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<int>( PAGE_SIZE / 1024 * (vm_info.free_count - vm_info.speculative_count)); meminfo->speculative = |