-
-
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
WasmPageAllocator improvements #3789
Comments
I had experimented with 2 styles of metadata with ZeeAlloc:
|
Here's another half-formed idea:
This strategy depends on being the global arbitrator of memory, which is probably reasonable. Other allocators generally want to use backing allocators. This seems like it would have low overhead and good perf to me (although I haven't tested it), and if that is true then it's probably worth having it. There could be another wasm allocator that didn't require being the global arbitrator of memory, with different perf/overhead characteristics, which one could use if necessary. But there are plenty of use cases where this assumption of being the only caller of the wasm intrinsics would hold. |
I like this approach. My only concern is how should we determine multiple pages? I had used the heuristic of alignForward the freed memory, but that's not guaranteed to be accurate after a shrink. But maybe it's good enough? Edit: after typing some of the examples out, I realized we can return excess pages upon shrink so this is a non-problem. |
Instead of reserving a constant set of memory, we can leverage |
Briefly discussed this over IRC.
The current wasm allocator has some implicit state that does not play nicely with other allocators that may directly use the intrinsic
memory.grow
. Additionally, wasm has its own challenges, like not providing a way to free memory.We should update the WasmPageAllocator to match the PageAllocator a bit closer:
The text was updated successfully, but these errors were encountered: