You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling Go programs to WebAssembly, the memory allocation strategy
was neither releasing memory to the OS nor reusing blocks freed by calls to
`runtime.sysFreeOS`.
This CL unifies the plan9 and wasm memory management strategy since both
platforms use a linear memory space and do not have a mechanism for
returning memory blocks to the OS.
Fixes#59061
// TODO(neelance): maybe unify with mem_plan9.go, depending on how https://github.com/WebAssembly/design/blob/master/FutureFeatures.md#finer-grained-control-over-memory turns out
46
-
47
-
ifv!=nil {
48
-
// The address space of WebAssembly's linear memory is contiguous,
49
-
// so requesting specific addresses is not supported. We could use
50
-
// a different address, but then mheap.sysAlloc discards the result
51
-
// right away and we don't reuse chunks passed to sysFree.
18
+
ifgrowMemory(grow) <0 {
52
19
returnnil
53
20
}
54
21
55
-
// Round up the initial reserveEnd to 64 KiB so that
56
-
// reservations are always aligned to the page size.
0 commit comments