-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Runtime page size detection #20511
base: master
Are you sure you want to change the base?
Runtime page size detection #20511
Conversation
Hi, thanks so much for putting in the work to make runtime page size a reality :) These |
Inlining: Else: |
Thanks, I am in favor of this. I believe you may be able to achieve this by assigning to a
Yes, |
Local tests now pass. I just can't figure out how to test on Windows. |
I'd like to re-run CI. I cannot get local tests to pass, but I would like to see how the CI runner behaves. There seems to be another issue besides page size that prevents me from running tests myself.
Whether I use this PR or just edit the Do these errors suggest anything in particular? Maybe I didn't replicate the CI script closely enough? |
I think you might need to rebase this on master for CI to run? 🤔 |
Doctests seem to depend on this behavior, and that is valid.
We are now missing only runtime querying for |
Other than the Plan 9 comment above, I think I'm comfortable signing off on the page size values picked here and the overall direction of the changes. @andrewrk I think now would be a good time for you to review the resulting changes throughout the standard library; you're probably more qualified for that than me. |
Thanks, looking now. |
There really is no query for wasm (or I don't care to add it until it's necessary). In the meantime, the test that checks for an existing method to query page sizes is not useful for wasm, so I add a test skip there.
GPA wants 4KiB pages, and besides, it won't even compile on freestanding soon enough: ziglang/zig#20511.
return queryPageSize(); | ||
} | ||
|
||
// Helper method for queryPageSize(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to say helper method for pageSize()? It says it's a helper method for itself right now.
This PR implements runtime page sizes. Closes #4082. Closes #11308. Closes #16331. Closes #20714.
Notable changes:
pageSize()
to get the runtime page size.page_size
in the standard library.page_size
to fromstd.mem
tostd.heap
.page_size
tomin_page_size
.max_page_size
to get the comptime upper bound on page size.Not implemented (debatable):
alignPage
alignment. This would generate slightly stricter runtime validation than the currentalign(min_page_size)
.