// Scan work performed on this gcWork. This is aggregated into
// gcController by dispose and may also be flushed by callers.
scanWork int64
+
+ // flushedWork indicates that a non-empty work buffer was
+ // flushed to the global work list since the last gcMarkDone
+ // termination check. Specifically, this indicates that this
+ // gcWork may have communicated work to another gcWork.
+ flushedWork bool
}
// Most of the methods of gcWork are go:nowritebarrierrec because the
wbuf = w.wbuf1
if wbuf.nobj == len(wbuf.obj) {
putfull(wbuf)
+ w.flushedWork = true
wbuf = getempty()
w.wbuf1 = wbuf
flushed = true
for len(obj) > 0 {
for wbuf.nobj == len(wbuf.obj) {
putfull(wbuf)
+ w.flushedWork = true
w.wbuf1, w.wbuf2 = w.wbuf2, getempty()
wbuf = w.wbuf1
flushed = true
putempty(wbuf)
} else {
putfull(wbuf)
+ w.flushedWork = true
}
w.wbuf1 = nil
putempty(wbuf)
} else {
putfull(wbuf)
+ w.flushedWork = true
}
w.wbuf2 = nil
}
}
if wbuf := w.wbuf2; wbuf.nobj != 0 {
putfull(wbuf)
+ w.flushedWork = true
w.wbuf2 = getempty()
} else if wbuf := w.wbuf1; wbuf.nobj > 4 {
w.wbuf1 = handoff(wbuf)
+ w.flushedWork = true // handoff did putfull
} else {
return
}