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.
Этот коммит содержится в:
родитель
4b1f92600f
коммит
5fa1e7163a
1 изменённых файлов: 2 добавлений и 1 удалений
|
@ -52,7 +52,8 @@ func SetFinalizer(obj interface{}, finalizer interface{}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func initHeap() {
|
func initHeap() {
|
||||||
// Nothing to initialize.
|
// preinit() may have moved heapStart; reset heapptr
|
||||||
|
heapptr = heapStart
|
||||||
}
|
}
|
||||||
|
|
||||||
// setHeapEnd sets a new (larger) heapEnd pointer.
|
// setHeapEnd sets a new (larger) heapEnd pointer.
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче