-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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? 🤔 |
Alright, rebased again. Though what I understood was that CI needed to be invoked by a Zig member. Hopefully I can fix up the stylistic issues soon. |
For the wasm failure in your local run of the tests, I see:
I suspect this is from using a too-recent wasmtime, and downgrading to v10.0.2 (which is the version CI runs) will fix it. See #20747. |
Just to make sure I correctly understand the motivation for the latest commits: The issue is that there's no page size defined for Assuming my understanding is correct, and assuming that this is the only motivation for these changes, then I would instead suggest just doing what @pfgithub suggested. It's a much smaller change and keeps the Basically, you just add a few fields to pub const Options = struct {
// ...
min_page_size: ?usize = null,
max_page_size ?usize = null,
query_page_size: fn () usize = heap.defaultQueryPageSize,
// ...
}; Now you change the Then you rename And that should be it, I think. Now programmers targeting |
Ah, I took being cross platform out of the box to be a requirement. I'll do that then. |
Other than the above minor comments, I think this looks good. @andrewrk might want to take another look. |
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.
I think all my concerns have been addressed.
This comment was marked as resolved.
This comment was marked as resolved.
|
c900fd3
to
84a301e
Compare
Needs a rebase. |
@RossComputerGuy please do not ask other contributors to rebase their code. @archbirdplus you do not need to rebase. This is waiting only on me to review and merge. Furthermore, since @alexrp already accepted it, if I find any issues, I will simply address them myself while merging. |
This PR implements runtime page sizes. Closes #4082. Closes #11308. Closes #16331. Closes #20038. Closes #20714.
Notable changes:
mem.page_size
.heap.min_page_size
,heap.max_page_size
,heap.pageSize()
.options.min_page_size
,options.max_page_size
,options.queryPageSizeFn
.Not implemented:
align_page
alignment value. Usealign(std.heap.min_page_size)
on your pointers instead.