func (w *gcWork) put(obj uintptr) {
	flushed := false
	wbuf := w.wbuf1
	// Record that this may acquire the wbufSpans or heap lock to
	// allocate a workbuf.
	lockWithRankMayAcquire(&work.wbufSpans.lock, lockRankWbufSpans)
	lockWithRankMayAcquire(&mheap_.lock, lockRankMheap)
	if wbuf == nil {
		w.init()
		wbuf = w.wbuf1
		// wbuf is empty at this point.
	} else if wbuf.nobj == len(wbuf.obj) {
		w.wbuf1, w.wbuf2 = w.wbuf2, w.wbuf1
		wbuf = w.wbuf1
		if wbuf.nobj == len(wbuf.obj) {
			putfull(wbuf)
			w.flushedWork = true
			wbuf = getempty()
			w.wbuf1 = wbuf
			flushed = true
		}
	}

	wbuf.obj[wbuf.nobj] = obj
	wbuf.nobj++

	// If we put a buffer on full, let the GC controller know so
	// it can encourage more workers to run. We delay this until
	// the end of put so that w is in a consistent state, since
	// enlistWorker may itself manipulate w.
	if flushed && gcphase == _GCmark {
		gcController.enlistWorker()
	}
}
// put enqueues a pointer for the garbage collector to trace.
// obj must point to the beginning of a heap object or an oblet.
//
//go:nowritebarrierrec
put enqueues a pointer for the garbage collector to trace.
obj must point to the beginning of a heap object or an oblet.

nowritebarrierrec
// put enqueues a pointer for the garbage collector to trace . // obj must point to the beginning of a heap object or an oblet . // // go : nowritebarrierrec
func (w *gcWork) put(obj uintptr) {
	flushed := false
	wbuf := w.wbuf1
	lockWithRankMayAcquire(&work.wbufSpans.lock, lockRankWbufSpans)
	lockWithRankMayAcquire(&mheap_.lock, lockRankMheap)
	if wbuf == nil {
		w.init()
		wbuf = w.wbuf1
	} else if wbuf.nobj == len(wbuf.obj) {
		w.wbuf1, w.wbuf2 = w.wbuf2, w.wbuf1
		wbuf = w.wbuf1
		if wbuf.nobj == len(wbuf.obj) {
			putfull(wbuf)
			w.flushedWork = true
			wbuf = getempty()
			w.wbuf1 = wbuf
			flushed = true
		}
	}
	wbuf.obj[wbuf.nobj] = obj
	wbuf.nobj++
	if flushed && gcphase == _GCmark {
		gcController.enlistWorker()
	}
}
func ( w * gcWork ) put ( obj uintptr ) { flushed := false wbuf := w . wbuf1 lockWithRankMayAcquire ( & work . wbufSpans . lock , lockRankWbufSpans ) lockWithRankMayAcquire ( & mheap_ . lock , lockRankMheap ) if wbuf == nil { w . init ( ) wbuf = w . wbuf1 } else if wbuf . nobj == len ( wbuf . obj ) { w . wbuf1 , w . wbuf2 = w . wbuf2 , w . wbuf1 wbuf = w . wbuf1 if wbuf . nobj == len ( wbuf . obj ) { putfull ( wbuf ) w . flushedWork = true wbuf = getempty ( ) w . wbuf1 = wbuf flushed = true } } wbuf . obj [ wbuf . nobj ] = obj wbuf . nobj ++ if flushed && gcphase == _GCmark { gcController . enlistWorker ( ) } }
put enqueues a pointer for the garbage collector to trace.
put enqueues a pointer for the garbage collector to trace .
// Record that this may acquire the wbufSpans or heap lock to // allocate a workbuf. // wbuf is empty at this point. // If we put a buffer on full, let the GC controller know so // it can encourage more workers to run. We delay this until // the end of put so that w is in a consistent state, since // enlistWorker may itself manipulate w.