diff --git a/internal/core/src/common/Utils.h b/internal/core/src/common/Utils.h index 6353af0d10..8f3ae1068d 100644 --- a/internal/core/src/common/Utils.h +++ b/internal/core/src/common/Utils.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -420,10 +421,10 @@ CreateMap(int64_t segment_id, #ifndef MAP_POPULATE // Manually access the mapping to populate it - const size_t PAGE_SIZE = 4 << 10; // 4KiB + const size_t page_size = getpagesize(); char* begin = (char*)map; char* end = begin + written; - for (char* page = begin; page < end; page += PAGE_SIZE) { + for (char* page = begin; page < end; page += page_size) { char value = page[0]; } #endif