mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: rename scanobject to scanObject
This is long overdue. Change-Id: I891b114cb581e82b903c20d1c455bbbdad548fe8 Reviewed-on: https://go-review.googlesource.com/c/go/+/690535 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
parent
41b429881a
commit
1aa154621d
6 changed files with 18 additions and 18 deletions
|
|
@ -692,7 +692,7 @@ func (span *mspan) writeHeapBitsSmall(x, dataSize uintptr, typ *_type) (scanSize
|
|||
// malloc does not call heapSetType* when there are no pointers.
|
||||
//
|
||||
// There can be read-write races between heapSetType* and things
|
||||
// that read the heap metadata like scanobject. However, since
|
||||
// that read the heap metadata like scanObject. However, since
|
||||
// heapSetType* is only used for objects that have not yet been
|
||||
// made reachable, readers will ignore bits being modified by this
|
||||
// function. This does mean this function cannot transiently modify
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ func gcScanFinalizer(spf *specialfinalizer, s *mspan, gcw *gcWork) {
|
|||
// the object (but *not* the object itself or
|
||||
// we'll never collect it).
|
||||
if !s.spanclass.noscan() {
|
||||
scanobject(p, gcw)
|
||||
scanObject(p, gcw)
|
||||
}
|
||||
|
||||
// The special itself is also a root.
|
||||
|
|
@ -1255,7 +1255,7 @@ func gcDrain(gcw *gcWork, flags gcDrainFlags) {
|
|||
}
|
||||
}
|
||||
if b != 0 {
|
||||
scanobject(b, gcw)
|
||||
scanObject(b, gcw)
|
||||
} else if s != 0 {
|
||||
scanSpan(s, gcw)
|
||||
} else {
|
||||
|
|
@ -1359,7 +1359,7 @@ func gcDrainN(gcw *gcWork, scanWork int64) int64 {
|
|||
}
|
||||
}
|
||||
if b != 0 {
|
||||
scanobject(b, gcw)
|
||||
scanObject(b, gcw)
|
||||
} else if s != 0 {
|
||||
scanSpan(s, gcw)
|
||||
} else {
|
||||
|
|
@ -1390,7 +1390,7 @@ func gcDrainN(gcw *gcWork, scanWork int64) int64 {
|
|||
return workFlushed + gcw.heapScanWork
|
||||
}
|
||||
|
||||
// scanblock scans b as scanobject would, but using an explicit
|
||||
// scanblock scans b as scanObject would, but using an explicit
|
||||
// pointer bitmap instead of the heap bitmap.
|
||||
//
|
||||
// This is used to scan non-heap roots, so it does not update
|
||||
|
|
@ -1415,7 +1415,7 @@ func scanblock(b0, n0 uintptr, ptrmask *uint8, gcw *gcWork, stk *stackScanState)
|
|||
}
|
||||
for j := 0; j < 8 && i < n; j++ {
|
||||
if bits&1 != 0 {
|
||||
// Same work as in scanobject; see comments there.
|
||||
// Same work as in scanObject; see comments there.
|
||||
p := *(*uintptr)(unsafe.Pointer(b + i))
|
||||
if p != 0 {
|
||||
if stk != nil && p >= stk.stack.lo && p < stk.stack.hi {
|
||||
|
|
|
|||
|
|
@ -852,16 +852,16 @@ func (w *gcWork) flushScanStats(dst *[gc.NumSizeClasses]sizeClassScanStats) {
|
|||
clear(w.stats[:])
|
||||
}
|
||||
|
||||
// scanobject scans the object starting at b, adding pointers to gcw.
|
||||
// scanObject scans the object starting at b, adding pointers to gcw.
|
||||
// b must point to the beginning of a heap object or an oblet.
|
||||
// scanobject consults the GC bitmap for the pointer mask and the
|
||||
// scanObject consults the GC bitmap for the pointer mask and the
|
||||
// spans for the size of the object.
|
||||
//
|
||||
// Used only for !gcUsesSpanInlineMarkBits spans, but supports all
|
||||
// object sizes and is safe to be called on all heap objects.
|
||||
//
|
||||
//go:nowritebarrier
|
||||
func scanobject(b uintptr, gcw *gcWork) {
|
||||
func scanObject(b uintptr, gcw *gcWork) {
|
||||
// Prefetch object before we scan it.
|
||||
//
|
||||
// This will overlap fetching the beginning of the object with initial
|
||||
|
|
@ -876,12 +876,12 @@ func scanobject(b uintptr, gcw *gcWork) {
|
|||
s := spanOfUnchecked(b)
|
||||
n := s.elemsize
|
||||
if n == 0 {
|
||||
throw("scanobject n == 0")
|
||||
throw("scanObject n == 0")
|
||||
}
|
||||
if s.spanclass.noscan() {
|
||||
// Correctness-wise this is ok, but it's inefficient
|
||||
// if noscan objects reach here.
|
||||
throw("scanobject of a noscan object")
|
||||
throw("scanObject of a noscan object")
|
||||
}
|
||||
|
||||
var tp typePointers
|
||||
|
|
|
|||
|
|
@ -116,13 +116,13 @@ func (w *gcWork) flushScanStats(dst *[gc.NumSizeClasses]sizeClassScanStats) {
|
|||
clear(w.stats[:])
|
||||
}
|
||||
|
||||
// scanobject scans the object starting at b, adding pointers to gcw.
|
||||
// scanObject scans the object starting at b, adding pointers to gcw.
|
||||
// b must point to the beginning of a heap object or an oblet.
|
||||
// scanobject consults the GC bitmap for the pointer mask and the
|
||||
// scanObject consults the GC bitmap for the pointer mask and the
|
||||
// spans for the size of the object.
|
||||
//
|
||||
//go:nowritebarrier
|
||||
func scanobject(b uintptr, gcw *gcWork) {
|
||||
func scanObject(b uintptr, gcw *gcWork) {
|
||||
// Prefetch object before we scan it.
|
||||
//
|
||||
// This will overlap fetching the beginning of the object with initial
|
||||
|
|
@ -137,12 +137,12 @@ func scanobject(b uintptr, gcw *gcWork) {
|
|||
s := spanOfUnchecked(b)
|
||||
n := s.elemsize
|
||||
if n == 0 {
|
||||
throw("scanobject n == 0")
|
||||
throw("scanObject n == 0")
|
||||
}
|
||||
if s.spanclass.noscan() {
|
||||
// Correctness-wise this is ok, but it's inefficient
|
||||
// if noscan objects reach here.
|
||||
throw("scanobject of a noscan object")
|
||||
throw("scanObject of a noscan object")
|
||||
}
|
||||
|
||||
var tp typePointers
|
||||
|
|
|
|||
|
|
@ -2199,7 +2199,7 @@ func addfinalizer(p unsafe.Pointer, f *funcval, nret uintptr, fint *_type, ot *p
|
|||
// Mark everything reachable from the object
|
||||
// so it's retained for the finalizer.
|
||||
if !span.spanclass.noscan() {
|
||||
scanobject(base, gcw)
|
||||
scanObject(base, gcw)
|
||||
}
|
||||
// Mark the finalizer itself, since the
|
||||
// special isn't part of the GC'd heap.
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ func wbBufFlush1(pp *p) {
|
|||
// pointers we greyed. We use the buffer itself to temporarily
|
||||
// record greyed pointers.
|
||||
//
|
||||
// TODO: Should scanobject/scanblock just stuff pointers into
|
||||
// TODO: Should scanObject/scanblock just stuff pointers into
|
||||
// the wbBuf? Then this would become the sole greying path.
|
||||
//
|
||||
// TODO: We could avoid shading any of the "new" pointers in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue