This reset of gcBlackenEnabled is a no-op because it was already reset
almost immediately before in gcMarkDone, which is the only caller of
gcMarkTermination.
Adjust the comment to clarify setGCPhase a bit more. We are coming from
_GCmark, so write barriers are already enabled.
Change-Id: Ieac2dadf33c3c5a44e8a25a499dea8cfe03b8d73
Reviewed-on: https://go-review.googlesource.com/c/go/+/241357
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
gcMarkTermination(nextTriggerRatio)
}
+// World must be stopped and mark assists and background workers must be
+// disabled.
func gcMarkTermination(nextTriggerRatio float64) {
- // World is stopped.
- // Start marktermination which includes enabling the write barrier.
- atomic.Store(&gcBlackenEnabled, 0)
+ // Start marktermination (write barrier remains enabled for now).
setGCPhase(_GCmarktermination)
work.heap1 = memstats.heap_live