From: Austin Clements Date: Mon, 12 Sep 2016 21:48:34 +0000 (-0400) Subject: runtime: don't reserve space for stack barriers if they're off X-Git-Tag: go1.8beta1~751 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7bc42a145a03d61b504b18d20f2a4e5d8e2436fd;p=gostls13.git 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 --- 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