mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 02:27:48 +00:00
src/runtime: reset heapptr to heapStart after preinit()
heapptr is assinged to heapStart (which is 0) when it's declared, but preinit() may have moved the heap somewhere else. Set heapptr to the proper value of heapStart when we initialize the heap properly. This allows the leaking allocator to work on unix.
This commit is contained in:
@@ -52,7 +52,8 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
|
||||
}
|
||||
|
||||
func initHeap() {
|
||||
// Nothing to initialize.
|
||||
// preinit() may have moved heapStart; reset heapptr
|
||||
heapptr = heapStart
|
||||
}
|
||||
|
||||
// setHeapEnd sets a new (larger) heapEnd pointer.
|
||||
|
||||
Reference in New Issue
Block a user