]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=off
authorAustin Clements <austin@google.com>
Mon, 25 Sep 2017 18:58:13 +0000 (14:58 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 20:23:11 +0000 (20:23 +0000)
commitebfcdef90174ea86b2952abec511c0be96b05099
treef1aef34b367a97037dad492416c1074077354deb
parent0ab99b396df9fc45c5cf1ac412da4f1848c3462c
[release-branch.go1.9] runtime: make runtime.GC() trigger GC even if GOGC=off

Currently, the priority of checks in (gcTrigger).test() puts the
gcpercent<0 test above gcTriggerCycle, which is used for runtime.GC().
This is an unintentional change from 1.8 and before, where
runtime.GC() triggered a GC even if GOGC=off.

Fix this by rearranging the priority so the gcTriggerCycle test
executes even if gcpercent < 0.

Fixes #22023.

Change-Id: I109328d7b643b6824eb9d79061a9e775f0149575
Reviewed-on: https://go-review.googlesource.com/65994
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
Reviewed-on: https://go-review.googlesource.com/70979
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/gc_test.go
src/runtime/mgc.go