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>
// 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
// 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.
}
}
if b != 0 {
- scanobject(b, gcw)
+ scanObject(b, gcw)
} else if s != 0 {
scanSpan(s, gcw)
} else {
}
}
if b != 0 {
- scanobject(b, gcw)
+ scanObject(b, gcw)
} else if s != 0 {
scanSpan(s, gcw)
} else {
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
}
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 {
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
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
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
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
// 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.
// 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