]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: rename scanobject to scanObject
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 25 Jul 2025 18:08:35 +0000 (18:08 +0000)
committerGopher Robot <gobot@golang.org>
Fri, 25 Jul 2025 18:35:41 +0000 (11:35 -0700)
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>

src/runtime/mbitmap.go
src/runtime/mgcmark.go
src/runtime/mgcmark_greenteagc.go
src/runtime/mgcmark_nogreenteagc.go
src/runtime/mheap.go
src/runtime/mwbbuf.go

index 7331886af276326992ed07d1d970b625eeb8052a..b2557275ece37365f140138e5f21b7cde4500541 100644 (file)
@@ -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
index b8a1d8fc146eb5655b2e88146a8ab75052f19337..a0087ab6e07b1cf93bc607e2b77b59a849e5ada6 100644 (file)
@@ -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 {
index 1f2db2e1bb1a18af0d7bb9c0a665ec6766d7de42..845857a817e70659b68c8e2db2cfd3ca2260f669 100644 (file)
@@ -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
index 3ae0802e6ce2f151ee8a133b2b8bc43d72b92c7d..63757731237caa4ca66b8d808036cc15badee3de 100644 (file)
@@ -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
index cc3116acb3387a8748921fff00a6bdf0a4a5969e..d8193ddb46d572e4860414d16ae303443e6e29e5 100644 (file)
@@ -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.
index 537d5585920ceda7daa698141c39cb483e08ce46..e8c6064905afe6c7f4725ab541d3ed08a879d51c 100644 (file)
@@ -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