]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: don't reserve space for stack barriers if they're off
authorAustin Clements <austin@google.com>
Mon, 12 Sep 2016 21:48:34 +0000 (17:48 -0400)
committerAustin Clements <austin@google.com>
Wed, 19 Oct 2016 21:36:37 +0000 (21:36 +0000)
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>
src/runtime/mstkbar.go

index 1bf9d573b70f59bca185b9db62e91feb488b8492..4415559b6cf0b6f843ae69e07a89e8968109be72 100644 (file)
@@ -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