-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
std.heap.PageAllocator: improve implementation on Windows using NtAllocateVirtualMemory #22846
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
Comments
Hi @andrewrk, I would be interested in exploring this. Cool if I take a stab? |
You're welcome to take a stab at any issue tagged with
contributor friendly
|
Apologies for closing the first PR, accidentally messed up with git. In regards to the initial tests I performed here were the results I was seeing:
|
Hi @alexrp and @andrewrk - I believe that most of the issue has been tackled now, but I would like to spark a conversation about the usage of Curious on how y'all would like to approach this issue - thanks! |
The standard library technically requires Windows 10, so I think it's completely fine for that to be the default code path. If someone cares enough to make the code run on older Windows versions, patches are welcome, but they should perform compile-time target OS version checks. That said, it is indeed important which exact Windows 10 version the function was introduced in. |
Sounds good - I'll get
|
That might be a problem then. Our current minimum supported version is Lines 219 to 248 in 1eb729b
Lines 570 to 575 in 1eb729b
This doesn't necessarily mean we can't make use of newer functions, but it does mean we'd at least need compile-time OS version checks. |
That said, we could perhaps consider bumping our minimum version: https://learn.microsoft.com/en-us/lifecycle/products/windows-10-home-and-pro I'll defer to @andrewrk on that. |
I hope I don't need to explain why this is not ideal:
zig/lib/std/heap/PageAllocator.zig
Lines 44 to 69 in d4c8507
This issue is a subtask of #1840.
Issue close criteria:
VirtualAlloc
from std libVirtualFree
from std libNtAllocateVirtualMemory
insteadMEM_RESERVE_PLACEHOLDER
to guarantee no raceAs a bonus, measure SmpAllocator performance on Windows before and after, as well as providing a comparison with kernel32 HeapAlloc and related functions.
Related:
next_mmap_addr_hint
on Windows #17377The text was updated successfully, but these errors were encountered: