Description
Quoting @daurnimator from #3815:
This PR removes mem.page_size
and replaces it with minimums and maximums. Originally I attempted to create a global variable page_size
, but I realised that this would not work when zig's own startup routines are not used (e.g. when zig is used to create a static library). There is no linux syscall to get the current page size if you don't have access to the auxiliary vector, so a hacky solution would be required (e.g. using the knowledge that madvise
returns EINVAL
on non-page aligned arguments, and doing a search for the page size)
This PR introduces mem.bufsiz
as a reasonable "default size" for buffers. The name is taken from the posix constant BUFSIZ
.
Additionally, on linux we now assert
that the page size in the auxiliary vector matches expectations.
This proposal solves #2564