return wbuf
}
-// Scan objects in wbuf until wbuf is empty (and on empty queue) or
-// lets scanobject put partially emptied wbuf on partial queue.
-// In any case there is no workbuf to return.
-// If drainallwbufs is true find all other available workbufs and repeat the process.
+// Scan objects in work buffers (starting with wbuf), blackening grey
+// objects until all work buffers have been drained.
//go:nowritebarrier
-func drainworkbuf(wbuf *workbuf, drainallwbufs bool) {
+func drainworkbuf(wbuf *workbuf) {
if wbuf == nil {
wbuf = getpartialorempty(472)
}
for {
if wbuf.nobj == 0 {
putempty(wbuf, 496)
- if !drainallwbufs {
- break
- }
// Refill workbuf from global queue.
wbuf = getfull(504)
if wbuf == nil { // nil means out of work barrier reached
// parallel mark for over GC roots
parfordo(work.markfor)
if gcphase != _GCscan {
- drainworkbuf(nil, true) // blocks in getfull
+ drainworkbuf(nil) // blocks in getfull
}
if trace.enabled {
// This is the concurrent mark phase.
//go:nowritebarrier
func gcmark_m() {
- drainworkbuf(nil, true)
+ drainworkbuf(nil)
// TODO add another harvestwbuf and reset work.nwait=0, work.ndone=0, and work.nproc=1
// and repeat the above drainworkbuf.
}
harvestwbufs() // move local workbufs onto global queues where the GC can find them
gchelperstart()
parfordo(work.markfor)
- drainworkbuf(nil, true)
+ drainworkbuf(nil)
if work.full != 0 {
throw("work.full != 0")