From 59877bfaaf0778d4cc2cbaf06cf5030144271349 Mon Sep 17 00:00:00 2001 From: Gleb Stepanov Date: Mon, 25 Jul 2016 16:25:44 +0300 Subject: [PATCH] runtime: rename variable Rename variable to bitScan according to TODO comment. Change-Id: I81dd8cc1ca28c0dc9308a654ad65cdf5b2fd2ce3 Reviewed-on: https://go-review.googlesource.com/25175 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Austin Clements --- src/runtime/mbitmap.go | 54 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go index ccefbcd8d6..f49fc67a0c 100644 --- a/src/runtime/mbitmap.go +++ b/src/runtime/mbitmap.go @@ -78,13 +78,13 @@ import ( const ( bitPointer = 1 << 0 - bitMarked = 1 << 4 // TODO: Rename bitScan. + bitScan = 1 << 4 heapBitsShift = 1 // shift offset between successive bitPointer or bitMarked entries heapBitmapScale = sys.PtrSize * (8 / 2) // number of data bytes described by one heap bitmap byte // all mark/pointer bits in a byte - bitMarkedAll = bitMarked | bitMarked<>h.shift)&bitMarked != 0 + return (*h.bitp>>h.shift)&bitScan != 0 } // isCheckmarked reports whether the heap bits have the checkmarked bit set. @@ -527,7 +527,7 @@ func (h heapBits) isCheckmarked(size uintptr) bool { // so we know that the initial word's 2-bit pair // and the second word's 2-bit pair are in the // same heap bitmap byte, *h.bitp. - return (*h.bitp>>(heapBitsShift+h.shift))&bitMarked != 0 + return (*h.bitp>>(heapBitsShift+h.shift))&bitScan != 0 } // setCheckmarked sets the checkmarked bit. @@ -539,7 +539,7 @@ func (h heapBits) setCheckmarked(size uintptr) { atomic.Or8(h.bitp, bitPointer<= nw { goto Phase3 } @@ -1174,16 +1174,16 @@ func heapBitsSetType(x, size, dataSize uintptr, typ *_type) { hb = (b & (bitPointer | bitPointer<>= 2 nb -= 2 // Note: no bitMarker for second word because that's // the checkmark. if gcphase == _GCoff { - *hbitp &^= uint8((bitPointer | bitMarked | (bitPointer << heapBitsShift)) << (2 * heapBitsShift)) + *hbitp &^= uint8((bitPointer | bitScan | (bitPointer << heapBitsShift)) << (2 * heapBitsShift)) *hbitp |= uint8(hb) } else { - atomic.And8(hbitp, ^(uint8(bitPointer|bitMarked|bitPointer<> h.shift) & (bitPointer | bitMarked) + have = (*h.bitp >> h.shift) & (bitPointer | bitScan) if i >= totalptr { want = 0 // deadmarker if typ.kind&kindGCProg != 0 && i < (totalptr+3)/4*4 { - want = bitMarked + want = bitScan } } else { if j < nptr && (*addb(ptrmask, j/8)>>(j%8))&1 != 0 { want |= bitPointer } if i != 1 { - want |= bitMarked + want |= bitScan } else { - have &^= bitMarked + have &^= bitScan } } if have != want { @@ -1377,7 +1377,7 @@ Phase4: // of x in the heap bitmap to scalar/dead. func heapBitsSetTypeNoScan(x uintptr) { h := heapBitsForAddr(uintptr(x)) - *h.bitp &^= (bitPointer | bitMarked) << h.shift + *h.bitp &^= (bitPointer | bitScan) << h.shift } var debugPtrmask struct { -- 2.48.1