aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgcpacer.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2021-04-01 19:09:40 +0000
committerMichael Knyszek <mknyszek@google.com>2021-04-14 14:03:55 +0000
commite9cc31e736a6a1931ab010a2fda0e5d0ac4e5127 (patch)
treec98ef9401abf63bbd8011f9dd2dc6c280f3dba3b /src/runtime/mgcpacer.go
parent3eaf75c13a2e86ff9f9ab8014caa7fc6b855f130 (diff)
downloadgo-e9cc31e736a6a1931ab010a2fda0e5d0ac4e5127.tar.gz
go-e9cc31e736a6a1931ab010a2fda0e5d0ac4e5127.zip
runtime: pass work.userForced to gcController.endCycle explicitly
For #44167. Change-Id: I15817006f1870d6237cd06dabad988da3f23a6d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/306604 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>
Diffstat (limited to 'src/runtime/mgcpacer.go')
-rw-r--r--src/runtime/mgcpacer.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/mgcpacer.go b/src/runtime/mgcpacer.go
index ba16c59052..6bf3e3f278 100644
--- a/src/runtime/mgcpacer.go
+++ b/src/runtime/mgcpacer.go
@@ -444,8 +444,10 @@ func (c *gcControllerState) revise() {
}
// endCycle computes the trigger ratio for the next cycle.
-func (c *gcControllerState) endCycle() float64 {
- if work.userForced {
+// userForced indicates whether the current GC cycle was forced
+// by the application.
+func (c *gcControllerState) endCycle(userForced bool) float64 {
+ if userForced {
// Forced GC means this cycle didn't start at the
// trigger, so where it finished isn't good
// information about how to adjust the trigger.