rutime/gc_leaking: ensure heapptr is aligned on wasm

This commit is contained in:
Damian Gryski
2021-10-13 09:49:42 -07:00
committed by Ayke
parent 4d5ec6c57b
commit a413d5dfe9
+6 -1
View File
@@ -53,7 +53,12 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
func initHeap() {
// 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.