Ben Visness
Ben Visness
We have now implemented memory.discard for shared memories in SpiderMonkey. The [document](https://docs.google.com/document/d/131BCKkMSdKCeU51XJ52mIy5O4i60CIGMopSh8aWNQG8/edit#) has been updated with our findings and recommendations, and our [demo](https://bvisness.me/apps/discard/) now supports shared memories as well. Windows...
To address a comment by @BlobTheKat on https://github.com/WebAssembly/design/issues/1543: > To make full use of this, we could create new memory with 65536 pages (4GB, the full address space) and physical...
Exceptions _would_ happen frequently in this scheme: every time a page is touched for the first time. That said, at this point we do still need to measure the overhead.
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...
> What is the difference with using the memory.discard instruction on that exact same region of memory? Modifying memory mappings is a very different operation from simply writing to memory....
I think you're right, and the "unmap" operation should probably be implemented by another PROT_NONE instead. As far as I'm aware, this should free any physical resources and reduce commit.
Yeah, that's also a good point. Returning -1 could probably work just fine for `memory.map` as well. I'm not sure that the other operations need to return error codes, but...
Setting a maximum size on memory is a thing you can do to control the memory footprint, especially since engines can use different allocation strategies when they know the memory...
To be clear, I agree that the TypeError is reasonable, but it is unclear how types based on `noexn` should be handled. I am basically just proposing that we update...
In my opinion it would be foolish to continue to increase the memory size limit without also adding new APIs that give you [better control over memory](https://github.com/WebAssembly/memory-control/blob/main/proposals/memory-control/Overview.md). We still don't...