summaryrefslogtreecommitdiff
path: root/src/runtime/mgc0.h
diff options
context:
space:
mode:
authorRick Hudson <rlh@golang.org>2014-11-04 13:31:34 -0500
committerRick Hudson <rlh@golang.org>2014-11-04 13:31:34 -0500
commit9155768e48e7de0fd0d6297eaa932d4c489e3f38 (patch)
treec3fa5804642a64da1e36b1f9a915a8f463a89559 /src/runtime/mgc0.h
parentf65bb028c5ceb4fb213b103f24a85f17cf67ac39 (diff)
downloadgo-9155768e48e7de0fd0d6297eaa932d4c489e3f38.tar.gz
[dev.garbage] runtime: Add gc mark verification pass.
This adds an independent mark phase to the GC that can be used to verify the the default concurrent mark phase has found all reachable objects. It uses the upper 2 bits of the boundary nibble to encode the mark leaving the lower bits to encode the boundary and the normal mark bit. LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/167130043
Diffstat (limited to 'src/runtime/mgc0.h')
-rw-r--r--src/runtime/mgc0.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime/mgc0.h b/src/runtime/mgc0.h
index 16fbe4665..519d7206e 100644
--- a/src/runtime/mgc0.h
+++ b/src/runtime/mgc0.h
@@ -45,8 +45,12 @@ enum {
// If you change these, also change scanblock.
// scanblock does "if(bits == BitsScalar || bits == BitsDead)" as "if(bits <= BitsScalar)".
BitsDead = 0,
- BitsScalar = 1,
- BitsPointer = 2,
+ BitsScalar = 1, // 01
+ BitsPointer = 2, // 10
+ BitsCheckMarkXor = 1, // 10
+ BitsScalarMarked = BitsScalar ^ BitsCheckMarkXor, // 00
+ BitsPointerMarked = BitsPointer ^ BitsCheckMarkXor, // 11
+
BitsMultiWord = 3,
// BitsMultiWord will be set for the first word of a multi-word item.
// When it is set, one of the following will be set for the second word.