runtime: convert gcController.maxStackScan to atomic type

For #53821.

Change-Id: I1bd23cdbc371011ec2331fb0a37482ecf99a063b
Reviewed-on: https://go-review.googlesource.com/c/go/+/417778
Run-TryBot: Michael Pratt <mpratt@google.com>
Reviewed-by: Austin Clements <austin@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
This commit is contained in:
Michael Pratt 2022-07-15 14:27:48 -04:00
parent e1b0da6144
commit 02fb9b8ca9
4 changed files with 6 additions and 9 deletions

View file

@ -1322,7 +1322,7 @@ func (c *GCController) StartCycle(stackSize, globalsSize uint64, scannableFrac f
if c.heapMarked > trigger {
trigger = c.heapMarked
}
c.maxStackScan = stackSize
c.maxStackScan.Store(stackSize)
c.globalsScan = globalsSize
c.heapLive.Store(trigger)
c.heapScan.Add(int64(float64(trigger-c.heapMarked) * scannableFrac))