aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/mgcsweep.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/mgcsweep.go b/src/runtime/mgcsweep.go
index 1a9c3b3e5f..191935dfd5 100644
--- a/src/runtime/mgcsweep.go
+++ b/src/runtime/mgcsweep.go
@@ -169,9 +169,10 @@ func (a *activeSweep) end(sl sweepLocker) {
throw("mismatched begin/end of activeSweep")
}
if a.state.CompareAndSwap(state, state-1) {
- if state != sweepDrainedMask {
+ if state-1 != sweepDrainedMask {
return
}
+ // We're the last sweeper, and there's nothing left to sweep.
if debug.gcpacertrace > 0 {
live := gcController.heapLive.Load()
print("pacer: sweep done at heap size ", live>>20, "MB; allocated ", (live-mheap_.sweepHeapLiveBasis)>>20, "MB during sweep; swept ", mheap_.pagesSwept.Load(), " pages at ", mheap_.sweepPagesPerByte, " pages/byte\n")