aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-09-12 17:48:34 -0400
committerAustin Clements <austin@google.com>2016-10-19 21:36:37 +0000
commit7bc42a145a03d61b504b18d20f2a4e5d8e2436fd (patch)
tree232cc3bdce2e54cf015ab4670fd3caa45c26a886 /src
parent5b7497f327f83510193b1ec1de2eabb287a02982 (diff)
downloadgo-7bc42a145a03d61b504b18d20f2a4e5d8e2436fd.tar.xz
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 <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rick Hudson <rlh@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/mstkbar.go4
1 files changed, 4 insertions, 0 deletions
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