mirror of https://github.com/golang/go.git
more readable
This commit is contained in:
parent
cd0fbe4941
commit
57205f91fe
|
|
@ -1064,7 +1064,9 @@ func newstack() {
|
||||||
// recheck the bounds on return.)
|
// recheck the bounds on return.)
|
||||||
if f := findfunc(gp.sched.pc); f.valid() {
|
if f := findfunc(gp.sched.pc); f.valid() {
|
||||||
max := uintptr(funcMaxSPDelta(f))
|
max := uintptr(funcMaxSPDelta(f))
|
||||||
for newsize-(gp.stack.hi-gp.sched.sp) < max+_StackGuard {
|
needed := max + _StackGuard
|
||||||
|
used := gp.stack.hi - gp.sched.sp
|
||||||
|
for newsize-used < needed {
|
||||||
newsize *= 2
|
newsize *= 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue