aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2017-02-09 14:11:13 -0500
committerAustin Clements <austin@google.com>2017-02-14 15:52:56 +0000
commit0993b2fd06a43a2e51b68dd7d8b0643e50c54b9d (patch)
treeac154cd3b3f707810484addea0eab4a99384d58b /src/runtime/proc.go
parentd089a6c7187f1ff85277515405ec6c641588a7ff (diff)
downloadgo-0993b2fd06a43a2e51b68dd7d8b0643e50c54b9d.tar.xz
runtime: remove g.stackAlloc
Since we're no longer stealing space for the stack barrier array from the stack allocation, the stack allocation is simply g.stack.hi-g.stack.lo. Updates #17503. Change-Id: Id9b450ae12c3df9ec59cfc4365481a0a16b7c601 Reviewed-on: https://go-review.googlesource.com/36621 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/runtime/proc.go')
-rw-r--r--src/runtime/proc.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index c960d81408..5fc7d25390 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -2812,7 +2812,6 @@ func malg(stacksize int32) *g {
})
newg.stackguard0 = newg.stack.lo + _StackGuard
newg.stackguard1 = ^uintptr(0)
- newg.stackAlloc = uintptr(stacksize)
}
return newg
}
@@ -2949,11 +2948,11 @@ func gfput(_p_ *p, gp *g) {
throw("gfput: bad status (not Gdead)")
}
- stksize := gp.stackAlloc
+ stksize := gp.stack.hi - gp.stack.lo
if stksize != _FixedStack {
// non-standard stack size - free it.
- stackfree(gp.stack, gp.stackAlloc)
+ stackfree(gp.stack)
gp.stack.lo = 0
gp.stack.hi = 0
gp.stackguard0 = 0
@@ -3016,13 +3015,12 @@ retry:
gp.stack = stackalloc(_FixedStack)
})
gp.stackguard0 = gp.stack.lo + _StackGuard
- gp.stackAlloc = _FixedStack
} else {
if raceenabled {
- racemalloc(unsafe.Pointer(gp.stack.lo), gp.stackAlloc)
+ racemalloc(unsafe.Pointer(gp.stack.lo), gp.stack.hi-gp.stack.lo)
}
if msanenabled {
- msanmalloc(unsafe.Pointer(gp.stack.lo), gp.stackAlloc)
+ msanmalloc(unsafe.Pointer(gp.stack.lo), gp.stack.hi-gp.stack.lo)
}
}
}