]> Cypherpunks repositories - gostls13.git/commit
runtime, cmd/link: optimize memory allocation on wasm
authorRichard Musiol <mail@richard-musiol.de>
Sun, 7 Apr 2019 22:36:55 +0000 (00:36 +0200)
committerRichard Musiol <neelance@gmail.com>
Tue, 16 Apr 2019 15:03:34 +0000 (15:03 +0000)
commit460f9c60689c38bdd938d09903f3b414f6082a7d
tree13b35308f3e97d6696bf4bd1a0dd78263b724b0e
parente47090ab40967c2e5e6058838319259b4cc0d508
runtime, cmd/link: optimize memory allocation on wasm

WebAssembly's memory is contiguous. Allocating memory at a high address
also allocates all memory up to that address. This change reduces
the initial memory allocated on wasm from 1GB to 16MB by using multiple
heap arenas and reducing the size of a heap arena.

Fixes #27462.

Change-Id: Ic941e6edcadd411e65a14cb2f9fd6c8eae02fc7a
Reviewed-on: https://go-review.googlesource.com/c/go/+/170950
Run-TryBot: Richard Musiol <neelance@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/link/internal/wasm/asm.go
src/runtime/malloc.go