diff options
| author | Austin Clements <austin@google.com> | 2015-02-12 15:22:49 -0500 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2015-02-13 15:34:39 +0000 |
| commit | 15c9a2ef4e2ba914c330eca8e86c6b6166986d27 (patch) | |
| tree | b7bd03abce514581f593ae30ef6e9a2d8eb29b48 /src | |
| parent | 1ac65f82adf00f6af925a266b9c8282325b3c39f (diff) | |
| download | go-15c9a2ef4e2ba914c330eca8e86c6b6166986d27.tar.xz | |
runtime: eliminate drainworkbufs from scanblock
scanblock is only called during _GCscan and _GCmarktermination.
During _GCscan, scanblock didn't call drainworkbufs anyway. During
_GCmarktermination, there's really no point in draining some (largely
arbitrary) amount of work during the scanblock, since the GC is about
to drain everything anyway, so simply eliminate this case.
Change-Id: I7f3c59ce9186a83037c6f9e9b143181acd04c597
Reviewed-on: https://go-review.googlesource.com/4783
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/runtime/mgc.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/runtime/mgc.go b/src/runtime/mgc.go index 27b3b1158f..4a9dcf1f50 100644 --- a/src/runtime/mgc.go +++ b/src/runtime/mgc.go @@ -419,9 +419,8 @@ func scanobject(b, n uintptr, ptrmask *uint8, wbuf *workbuf) *workbuf { return wbuf } -// scanblock starts by scanning b as scanobject would. -// If the gcphase is GCscan, that's all scanblock does. -// Otherwise it traverses some fraction of the pointers it found in b, recursively. +// scanblock scans b as scanobject would. +// If the gcphase is GCscan, scanblock performs additional checks. //go:nowritebarrier func scanblock(b0, n0 uintptr, ptrmask *uint8, wbuf *workbuf) *workbuf { // Use local copies of original parameters, so that a stack trace @@ -443,11 +442,8 @@ func scanblock(b0, n0 uintptr, ptrmask *uint8, wbuf *workbuf) *workbuf { // b is in heap, we are in GCscan so there should be a ptrmask. throw("scanblock: In GCscan phase and inheap is true.") } - return wbuf } - - drainworkbuf(wbuf, false) - return nil + return wbuf } // Scan objects in wbuf until wbuf is empty (and on empty queue) or |
