]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: improve initSpan documentation
authorAustin Clements <austin@google.com>
Tue, 9 Feb 2016 22:34:14 +0000 (17:34 -0500)
committerAustin Clements <austin@google.com>
Thu, 25 Feb 2016 23:37:14 +0000 (23:37 +0000)
Change-Id: I9c45aad1c35a99da4c3b8990649dcd962fd23b81
Reviewed-on: https://go-review.googlesource.com/19631
Reviewed-by: Rick Hudson <rlh@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/runtime/mbitmap.go

index 35fc82bf4ac3aedf998f7ffdd0e5cdb2237481f9..04992890a18497de2f1967fbea5e2734f72c794c 100644 (file)
@@ -494,6 +494,10 @@ func typeBitsBulkBarrier(typ *_type, p, size uintptr) {
 // TODO(rsc): Perhaps introduce a different heapBitsSpan type.
 
 // initSpan initializes the heap bitmap for a span.
+// It clears all mark and checkmark bits.
+// If this is a span of pointer-sized objects, it initializes all
+// words to pointer (and there are no dead bits).
+// Otherwise, it initializes all words to scalar/dead.
 func (h heapBits) initSpan(size, n, total uintptr) {
        if total%heapBitmapScale != 0 {
                throw("initSpan: unaligned length")