mimalloc
mimalloc copied to clipboard
MI_SECURE vs. 16KiB page size: assertion failed
Running v3.1.5 debug test binaries with MI_SECURE in arm64-osx vcpkg triplet fails in https://github.com/microsoft/mimalloc/blob/dfa50c37d951128b1e77167dd9291081aa88eea4/src/os.c#L55
I realized that gsize is a runtime property obtained via sysconf(_SC_PAGESIZE), and I could verify that its value is 16384 in the affected Apple silicon builds, and that 8192 <= MI_ARENA_SLICE_SIZE/8 < 16384.
Is the assertion too strict, or does the result MI_ARENA_SLICE_SIZE/8 need to change?
I guess that modern Android environments could be affected as well, https://developer.android.com/guide/practices/page-sizes?hl=en.
Background: https://github.com/microsoft/vcpkg/pull/44699
I’m new to mimalloc and also just hit this.
Thanks! I think this is fixed in the latest dev3; actually the assert is just to "warn" that we use smallish slices for such large OS page size. The fix now increases the arena slice size to 128KiB to reduce waste when building in secure mode on arm64 on Apple.
Thank you. Did you also consider the Android case?