Skip to content

Commit 1aa1546

Browse files
mknyszekgopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Michael Pratt <[email protected]> Auto-Submit: Michael Knyszek <[email protected]>
1 parent 41b4298 commit 1aa1546

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

src/runtime/mbitmap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ func (span *mspan) writeHeapBitsSmall(x, dataSize uintptr, typ *_type) (scanSize
692692
// malloc does not call heapSetType* when there are no pointers.
693693
//
694694
// There can be read-write races between heapSetType* and things
695-
// that read the heap metadata like scanobject. However, since
695+
// that read the heap metadata like scanObject. However, since
696696
// heapSetType* is only used for objects that have not yet been
697697
// made reachable, readers will ignore bits being modified by this
698698
// function. This does mean this function cannot transiently modify

src/runtime/mgcmark.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ func gcScanFinalizer(spf *specialfinalizer, s *mspan, gcw *gcWork) {
421421
// the object (but *not* the object itself or
422422
// we'll never collect it).
423423
if !s.spanclass.noscan() {
424-
scanobject(p, gcw)
424+
scanObject(p, gcw)
425425
}
426426

427427
// The special itself is also a root.
@@ -1255,7 +1255,7 @@ func gcDrain(gcw *gcWork, flags gcDrainFlags) {
12551255
}
12561256
}
12571257
if b != 0 {
1258-
scanobject(b, gcw)
1258+
scanObject(b, gcw)
12591259
} else if s != 0 {
12601260
scanSpan(s, gcw)
12611261
} else {
@@ -1359,7 +1359,7 @@ func gcDrainN(gcw *gcWork, scanWork int64) int64 {
13591359
}
13601360
}
13611361
if b != 0 {
1362-
scanobject(b, gcw)
1362+
scanObject(b, gcw)
13631363
} else if s != 0 {
13641364
scanSpan(s, gcw)
13651365
} else {
@@ -1390,7 +1390,7 @@ func gcDrainN(gcw *gcWork, scanWork int64) int64 {
13901390
return workFlushed + gcw.heapScanWork
13911391
}
13921392

1393-
// scanblock scans b as scanobject would, but using an explicit
1393+
// scanblock scans b as scanObject would, but using an explicit
13941394
// pointer bitmap instead of the heap bitmap.
13951395
//
13961396
// 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)
14151415
}
14161416
for j := 0; j < 8 && i < n; j++ {
14171417
if bits&1 != 0 {
1418-
// Same work as in scanobject; see comments there.
1418+
// Same work as in scanObject; see comments there.
14191419
p := *(*uintptr)(unsafe.Pointer(b + i))
14201420
if p != 0 {
14211421
if stk != nil && p >= stk.stack.lo && p < stk.stack.hi {

src/runtime/mgcmark_greenteagc.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -852,16 +852,16 @@ func (w *gcWork) flushScanStats(dst *[gc.NumSizeClasses]sizeClassScanStats) {
852852
clear(w.stats[:])
853853
}
854854

855-
// scanobject scans the object starting at b, adding pointers to gcw.
855+
// scanObject scans the object starting at b, adding pointers to gcw.
856856
// b must point to the beginning of a heap object or an oblet.
857-
// scanobject consults the GC bitmap for the pointer mask and the
857+
// scanObject consults the GC bitmap for the pointer mask and the
858858
// spans for the size of the object.
859859
//
860860
// Used only for !gcUsesSpanInlineMarkBits spans, but supports all
861861
// object sizes and is safe to be called on all heap objects.
862862
//
863863
//go:nowritebarrier
864-
func scanobject(b uintptr, gcw *gcWork) {
864+
func scanObject(b uintptr, gcw *gcWork) {
865865
// Prefetch object before we scan it.
866866
//
867867
// This will overlap fetching the beginning of the object with initial
@@ -876,12 +876,12 @@ func scanobject(b uintptr, gcw *gcWork) {
876876
s := spanOfUnchecked(b)
877877
n := s.elemsize
878878
if n == 0 {
879-
throw("scanobject n == 0")
879+
throw("scanObject n == 0")
880880
}
881881
if s.spanclass.noscan() {
882882
// Correctness-wise this is ok, but it's inefficient
883883
// if noscan objects reach here.
884-
throw("scanobject of a noscan object")
884+
throw("scanObject of a noscan object")
885885
}
886886

887887
var tp typePointers

src/runtime/mgcmark_nogreenteagc.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ func (w *gcWork) flushScanStats(dst *[gc.NumSizeClasses]sizeClassScanStats) {
116116
clear(w.stats[:])
117117
}
118118

119-
// scanobject scans the object starting at b, adding pointers to gcw.
119+
// scanObject scans the object starting at b, adding pointers to gcw.
120120
// b must point to the beginning of a heap object or an oblet.
121-
// scanobject consults the GC bitmap for the pointer mask and the
121+
// scanObject consults the GC bitmap for the pointer mask and the
122122
// spans for the size of the object.
123123
//
124124
//go:nowritebarrier
125-
func scanobject(b uintptr, gcw *gcWork) {
125+
func scanObject(b uintptr, gcw *gcWork) {
126126
// Prefetch object before we scan it.
127127
//
128128
// This will overlap fetching the beginning of the object with initial
@@ -137,12 +137,12 @@ func scanobject(b uintptr, gcw *gcWork) {
137137
s := spanOfUnchecked(b)
138138
n := s.elemsize
139139
if n == 0 {
140-
throw("scanobject n == 0")
140+
throw("scanObject n == 0")
141141
}
142142
if s.spanclass.noscan() {
143143
// Correctness-wise this is ok, but it's inefficient
144144
// if noscan objects reach here.
145-
throw("scanobject of a noscan object")
145+
throw("scanObject of a noscan object")
146146
}
147147

148148
var tp typePointers

src/runtime/mheap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2199,7 +2199,7 @@ func addfinalizer(p unsafe.Pointer, f *funcval, nret uintptr, fint *_type, ot *p
21992199
// Mark everything reachable from the object
22002200
// so it's retained for the finalizer.
22012201
if !span.spanclass.noscan() {
2202-
scanobject(base, gcw)
2202+
scanObject(base, gcw)
22032203
}
22042204
// Mark the finalizer itself, since the
22052205
// special isn't part of the GC'd heap.

src/runtime/mwbbuf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func wbBufFlush1(pp *p) {
215215
// pointers we greyed. We use the buffer itself to temporarily
216216
// record greyed pointers.
217217
//
218-
// TODO: Should scanobject/scanblock just stuff pointers into
218+
// TODO: Should scanObject/scanblock just stuff pointers into
219219
// the wbBuf? Then this would become the sole greying path.
220220
//
221221
// TODO: We could avoid shading any of the "new" pointers in

0 commit comments

Comments
 (0)