Browse Source

rutime/gc_leaking: ensure heapptr is aligned on wasm

pull/2183/head
Damian Gryski 3 years ago
committed by Ayke
parent
commit
a413d5dfe9
  1. 7
      src/runtime/gc_leaking.go

7
src/runtime/gc_leaking.go

@ -53,7 +53,12 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
func initHeap() { func initHeap() {
// preinit() may have moved heapStart; reset heapptr // preinit() may have moved heapStart; reset heapptr
heapptr = heapStart ptr := heapStart
if GOARCH == "wasm" {
// llvm11 and llvm12 do not correctly align the heap on wasm
ptr = align(ptr)
}
heapptr = ptr
} }
// setHeapEnd sets a new (larger) heapEnd pointer. // setHeapEnd sets a new (larger) heapEnd pointer.

Loading…
Cancel
Save