mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: convert gcController.heapScan to atomic type
For #53821. Change-Id: I64d3f53c89a579d93056906304e4c05fc35cd9b3 Reviewed-on: https://go-review.googlesource.com/c/go/+/417776 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:
parent
3a9281ff61
commit
6e9925c4f7
3 changed files with 12 additions and 14 deletions
|
|
@ -1325,7 +1325,7 @@ func (c *GCController) StartCycle(stackSize, globalsSize uint64, scannableFrac f
|
|||
c.maxStackScan = stackSize
|
||||
c.globalsScan = globalsSize
|
||||
c.heapLive.Store(trigger)
|
||||
c.heapScan += uint64(float64(trigger-c.heapMarked) * scannableFrac)
|
||||
c.heapScan.Add(int64(float64(trigger-c.heapMarked) * scannableFrac))
|
||||
c.startCycle(0, gomaxprocs, gcTrigger{kind: gcTriggerHeap})
|
||||
}
|
||||
|
||||
|
|
@ -1359,7 +1359,7 @@ type GCControllerReviseDelta struct {
|
|||
|
||||
func (c *GCController) Revise(d GCControllerReviseDelta) {
|
||||
c.heapLive.Add(d.HeapLive)
|
||||
c.heapScan += uint64(d.HeapScan)
|
||||
c.heapScan.Add(d.HeapScan)
|
||||
c.heapScanWork.Add(d.HeapScanWork)
|
||||
c.stackScanWork.Add(d.StackScanWork)
|
||||
c.globalsScanWork.Add(d.GlobalsScanWork)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue