Skip to content
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

Add mremap to std.posix, and use it in std.heap.PageAllocator when available. #22199

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

SeanTheGleaming
Copy link
Contributor

Additionally moves std.heap.next_mmap_addr_hint into std.heap.PageAllocator, the only place in the stdlib where it is used.
As it stands, this PR is fully functional, but I am setting this as a draft, as between its limited support and sometimes variable length arguments, there is some ambiguity around the proper way to expose mremap in std.posix. My hope is to get the opinions of more prominent contributors and potentially core members.
I haven't done any serious or proper benchmarks, but on targets which support mremap, just from watching the output of naive test programs, this seems to have made a substantial improvement in the performance of resize operations in std.heap.page_allocator.

@SeanTheGleaming
Copy link
Contributor Author

It should be mentioned that this PR also resolved some TODOs in PageAllocator.zig

@alexrp
Copy link
Member

alexrp commented Dec 12, 2024

Just noting that this is very likely to have merge conflicts with #20511.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants