mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 11:33:59 +00:00
rutime/gc_leaking: ensure heapptr is aligned on wasm
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user