From 375d696ddf102d64729a21f931f4e1d8bfa82ce5 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Fri, 1 Apr 2022 22:34:45 +0000 Subject: runtime: move inconsistent memstats into gcController Fundamentally, all of these memstats exist to serve the runtime in managing memory. For the sake of simpler testing, couple these stats more tightly with the GC. This CL was mostly done automatically. The fields had to be moved manually, but the references to the fields were updated via gofmt -w -r 'memstats. -> gcController.' *.go For #48409. Change-Id: Ic036e875c98138d9a11e1c35f8c61b784c376134 Reviewed-on: https://go-review.googlesource.com/c/go/+/397678 Reviewed-by: Michael Pratt Run-TryBot: Michael Knyszek TryBot-Result: Gopher Robot --- src/runtime/malloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 30a2a5f289..f65be2bc74 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -566,7 +566,7 @@ func (h *mheap) sysAlloc(n uintptr) (v unsafe.Pointer, size uintptr) { // First, try the arena pre-reservation. // Newly-used mappings are considered released. - v = h.arena.alloc(n, heapArenaBytes, &memstats.heapReleased) + v = h.arena.alloc(n, heapArenaBytes, &gcController.heapReleased) if v != nil { size = n goto mapped -- cgit v1.3