]> Cypherpunks repositories - gostls13.git/commit
runtime: move internal GC statistics from memstats to gcController
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 31 Mar 2021 22:55:06 +0000 (22:55 +0000)
committerMichael Knyszek <mknyszek@google.com>
Tue, 13 Apr 2021 23:42:29 +0000 (23:42 +0000)
commitf2d5bd1ad306e87804d600d92105dc37279af83f
tree3469c5e88ec761a320877fba1e3aed6e21f0ae7f
parent8c2a8b1771cd7ed2182f4d03b3c4bd09828315ce
runtime: move internal GC statistics from memstats to gcController

This change moves certain important but internal-only GC statistics from
memstats into gcController. These statistics are mainly used in pacing
the GC, so it makes sense to keep them in the pacer's state.

This CL was mostly generated via

rf '
    ex . {
memstats.gc_trigger -> gcController.trigger
memstats.triggerRatio -> gcController.triggerRatio
memstats.heap_marked -> gcController.heapMarked
memstats.heap_live -> gcController.heapLive
memstats.heap_scan -> gcController.heapScan
    }
'

except for a few special cases, like updating names in comments and when
these fields are used within gcControllerState methods (at which point
they're accessed through the reciever).

For #44167.

Change-Id: I6bd1602585aeeb80818ded24c07d8e6fec992b93
Reviewed-on: https://go-review.googlesource.com/c/go/+/306598
Trust: Michael Knyszek <mknyszek@google.com>
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mcache.go
src/runtime/mgc.go
src/runtime/mgcpacer.go
src/runtime/mgcsweep.go
src/runtime/mheap.go
src/runtime/mstats.go
src/runtime/trace.go