Open lpereira opened 1 week ago
For -gc=leaking
this seems correct.
But in fact, you can do this optimization for every system except for baremetal (and nintendoswitch I think). Linux and Windows zero the memory in mmap
and VirtualAlloc
. For MacOS I couldn't find it anywhere online, but I would be very surprised if the returned pages weren't zeroed: every other Unix variant does this.
@aykevl So I guess we can just tweak the build tags here. LGTM otherwise.
Wasm linear memory is always initialized to zero by definition, so there's no need to waste time zeroing out this allocation.