aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mbitmap.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-02-09 17:34:14 -0500
committerAustin Clements <austin@google.com>2016-02-25 23:37:14 +0000
commit39f2bd737bb0b9446b4d241aa76fcb87d7e77278 (patch)
tree9c6b33cfc760adb55b47f644a20c64a029c55c8b /src/runtime/mbitmap.go
parente1024b6030e181f3994d93cac6099d3d0f341260 (diff)
downloadgo-39f2bd737bb0b9446b4d241aa76fcb87d7e77278.tar.xz
runtime: improve initSpan documentation
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>
Diffstat (limited to 'src/runtime/mbitmap.go')
-rw-r--r--src/runtime/mbitmap.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/mbitmap.go b/src/runtime/mbitmap.go
index 35fc82bf4a..04992890a1 100644
--- a/src/runtime/mbitmap.go
+++ b/src/runtime/mbitmap.go
@@ -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")