Description
Zig Version
0.10.0-dev.1434+676652865
Steps to Reproduce
I am running Linux on a MacBook Pro which uses 16 KiB pages; however, Zig's std lib always assumes 4 KiB pages on Linux running on aarch64.
Expected Behavior
Zig should infer/detect the correct page size.
Actual Behavior
Zig assumes 4 KiB pages, which results in errors in calls to msync
or mmap
(e.g. in std.debug.captureStackTrace
).
#4082 is mentioned in the source code, so I'm guessing that is the long term solution. That issue also mentions a "hacky" solution of using madvise
to check for a valid page size. A short term solution could be to check madvise
at compile time when running Linux on aarch64 to check between all possible page sizes (ARM64 can also support 64 KiB pages). If this is acceptable I can open a PR. EDIT: It looks like syscalls can't run at comptime so I don't think this would work.