From 7bc42a145a03d61b504b18d20f2a4e5d8e2436fd Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Mon, 12 Sep 2016 17:48:34 -0400 Subject: [PATCH] runtime: don't reserve space for stack barriers if they're off Change-Id: I79ebccdaefc434c47b77bd545cc3c50723c18b61 Reviewed-on: https://go-review.googlesource.com/31135 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Rick Hudson --- src/runtime/mstkbar.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/mstkbar.go b/src/runtime/mstkbar.go index 1bf9d573b7..4415559b6c 100644 --- a/src/runtime/mstkbar.go +++ b/src/runtime/mstkbar.go @@ -148,6 +148,10 @@ var firstStackBarrierOffset = 1024 // gcMaxStackBarriers returns the maximum number of stack barriers // that can be installed in a stack of stackSize bytes. func gcMaxStackBarriers(stackSize int) (n int) { + if debug.gcstackbarrieroff > 0 { + return 0 + } + if firstStackBarrierOffset == 0 { // Special debugging case for inserting stack barriers // at every frame. Steal half of the stack for the