diff -r fd948e5af26e -r 2cbdb482d325 src/allocator.c --- a/src/allocator.c Thu Dec 04 18:57:54 2025 +0100 +++ b/src/allocator.c Fri Dec 05 16:11:39 2025 +0100 @@ -31,6 +31,35 @@ #include #include +#ifdef _WIN32 +#include +#include +unsigned long system_page_size(void) { + static unsigned long ps = 0; + if (ps == 0) { + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + ps = (unsigned long) sysinfo.dwPageSize; + } + return ps; +} +#else +#include +unsigned long system_page_size(void) { + static unsigned long ps = 0; + if (ps == 0) { + long sc = sysconf(_SC_PAGESIZE); + if (sc < 0) { + // fallback for systems which do not report a value here + ps = 4096; // LCOV_EXCL_LINE + } else { + ps = (unsigned long) sc; + } + } + return ps; +} +#endif + static void *cx_malloc_stdlib( cx_attr_unused void *d, size_t n