[wasm][gc] Make pages inaccessible instead of discarding them
On Linux, both APIs uses {madvise} (and {SetPermissions} additionally does an {mprotect}), on windows they use different APIs. It turns out that {SetPermissions} with {kNoAccess} uses {VirtualFree} with {MEM_DECOMMIT}, so the pages will only be "reserved" afterwards. {DiscardSystemPages} on the other hand uses the {DiscardVirtualMemory} which tells the OS that the content of that memory can be discarded, but the pages stay "committed". Thus {SetPermissions} with {kNoAccess} frees significantly more memory than using {DiscardSystemPages}. R=mstarzinger@chromium.org Bug: v8:8217 Change-Id: I3555462a9c692f15ecb3eca7834eb181617d9ef9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1730992Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#63029}
Showing
Please
register
or
sign in
to comment