that allow the garbage collector to avoid repeating a stack scan during the
mark termination phase.
+ gcstackbarrierall: setting gcstackbarrierall=1 installs stack barriers
+ in every stack frame, rather than in exponentially-spaced frames.
+
gcstoptheworld: setting gcstoptheworld=1 disables concurrent garbage collection,
making every garbage collection a stop-the-world event. Setting gcstoptheworld=2
also disables concurrent sweeping after the garbage collection finishes.
_RootFlushCaches = 4
_RootCount = 5
- // firstStackBarrierOffset is the approximate byte offset at
- // which to place the first stack barrier from the current SP.
- // This is a lower bound on how much stack will have to be
- // re-scanned during mark termination. Subsequent barriers are
- // placed at firstStackBarrierOffset * 2^n offsets.
- //
- // For debugging, this can be set to 0, which will install a
- // stack barrier at every frame. If you do this, you may also
- // have to raise _StackMin, since the stack barrier
- // bookkeeping will use a large amount of each stack.
- firstStackBarrierOffset = 1024
- debugStackBarrier = false
+ debugStackBarrier = false
// sweepMinHeapDistance is a lower bound on the heap distance
// (in bytes) reserved for concurrent sweeping between GC
sweepMinHeapDistance = 1024 * 1024
)
+// firstStackBarrierOffset is the approximate byte offset at
+// which to place the first stack barrier from the current SP.
+// This is a lower bound on how much stack will have to be
+// re-scanned during mark termination. Subsequent barriers are
+// placed at firstStackBarrierOffset * 2^n offsets.
+//
+// For debugging, this can be set to 0, which will install a
+// stack barrier at every frame. If you do this, you may also
+// have to raise _StackMin, since the stack barrier
+// bookkeeping will use a large amount of each stack.
+var firstStackBarrierOffset = 1024
+
// heapminimum is the minimum heap size at which to trigger GC.
// For small heaps, this overrides the usual GOGC*live set rule.
//
gcpacertrace int32
gcshrinkstackoff int32
gcstackbarrieroff int32
+ gcstackbarrierall int32
gcstoptheworld int32
gctrace int32
invalidptr int32
{"gcpacertrace", &debug.gcpacertrace},
{"gcshrinkstackoff", &debug.gcshrinkstackoff},
{"gcstackbarrieroff", &debug.gcstackbarrieroff},
+ {"gcstackbarrierall", &debug.gcstackbarrierall},
{"gcstoptheworld", &debug.gcstoptheworld},
{"gctrace", &debug.gctrace},
{"invalidptr", &debug.invalidptr},
if islibrary || isarchive {
traceback_cache |= 1
}
+
+ if debug.gcstackbarrierall > 0 {
+ firstStackBarrierOffset = 0
+ }
}
// Poor mans 64-bit division.