runtime: convert gcController.globalsScan to atomic type

For #53821.

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

View file

@ -1323,7 +1323,7 @@ func (c *GCController) StartCycle(stackSize, globalsSize uint64, scannableFrac f
trigger = c.heapMarked
}
c.maxStackScan.Store(stackSize)
c.globalsScan = globalsSize
c.globalsScan.Store(globalsSize)
c.heapLive.Store(trigger)
c.heapScan.Add(int64(float64(trigger-c.heapMarked) * scannableFrac))
c.startCycle(0, gomaxprocs, gcTrigger{kind: gcTriggerHeap})