mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
runtime: heapptr only needs to be initialized once
There is no need to initialize it twice.
This commit is contained in:
@@ -11,7 +11,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Ever-incrementing pointer: no memory is freed.
|
// Ever-incrementing pointer: no memory is freed.
|
||||||
var heapptr = heapStart
|
var heapptr uintptr
|
||||||
|
|
||||||
// Total amount allocated for runtime.MemStats
|
// Total amount allocated for runtime.MemStats
|
||||||
var gcTotalAlloc uint64
|
var gcTotalAlloc uint64
|
||||||
@@ -93,7 +93,8 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initHeap() {
|
func initHeap() {
|
||||||
// preinit() may have moved heapStart; reset heapptr
|
// Initialize this bump-pointer allocator to the start of the heap.
|
||||||
|
// Needed here because heapStart may not be a compile-time constant.
|
||||||
heapptr = heapStart
|
heapptr = heapStart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user