-
Notifications
You must be signed in to change notification settings - Fork 2
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
memory.discard
in a separate proposal?
#7
Comments
It might make sense to split it into its own proposal if others agree. However, I would prefer to consider the memory story of WebAssembly more broadly, and given the lack of activity across this entire proposal, I wouldn't feel comfortable splitting it out without more discussion from multiple parties. It's very possible that landing A personal concern for me is whether memory APIs are best implemented in core WebAssembly or on the host. Obviously my prototype of TL;DR until anyone can devote active attention to this, I'd rather not split it out. |
Is this issue also present for the |
Discard makes the address range "disappear" - while no indices need to change the underlying memory gets deallocated (this is realistically achieved by memory mapping in the runtime).
Would this be similar to how array views handle changing memory size (which has some perf implications when many views are open)? I guess array view can also poke into the discarded section. |
Yes, but from the point of view of the guest, isn't it the same behaviour? In the implementation of SpiderMonkey, if I understood correctly: if the memory has been discarded and then is accessed again, the OS reallocates it with zero bytes instead. |
It changes the footprint - when you deallocate everything on a memory page, it then gets |
Modifying memory mappings is a very different operation from simply writing to memory. Operating system memory APIs vary quite significantly in what they allow - in particular, while Mac and Linux allow you to Point is, even something as simple as |
I'm not strongly opposed to splitting |
Hi!
I think it would be better to put the
memory.discard
instruction into a separate proposal.Grouping this instruction with other features is not strictly necessary and slows down the work on it. Current open questions only concern other features, and this proposal doesn't seem to be very active at the moment.
The instruction even already has been implemented on SpiderMonkey.
I believe that having this instruction standardized quicker would be beneficial as there is currently no way to explicitly restore memory back to the OS, which is a major usability issue for mobile usecases.
The text was updated successfully, but these errors were encountered: