-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Replace mem.page_size with mem.min_page_size and mem.max_page_size #4082
Copy link
Copy link
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.This issue suggests language modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Quoting @daurnimator from #3815:
This PR removes
mem.page_sizeand replaces it with minimums and maximums. Originally I attempted to create a global variablepage_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 thatmadvisereturnsEINVALon non-page aligned arguments, and doing a search for the page size)This PR introduces
mem.bufsizas a reasonable "default size" for buffers. The name is taken from the posix constantBUFSIZ.Additionally, on linux we now
assertthat the page size in the auxiliary vector matches expectations.This proposal solves #2564