/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "mozjemalloc.h" #include #ifdef XP_WIN # include #else # include #endif size_t GetKernelPageSize() { static size_t kernel_page_size = ([]() { #ifdef XP_WIN SYSTEM_INFO info; GetSystemInfo(&info); return info.dwPageSize; #else long result = sysconf(_SC_PAGESIZE); MOZ_ASSERT(result != -1); return result; #endif })(); return kernel_page_size; }