more readable

This commit is contained in:
go101 2021-07-02 03:58:32 -04:00
parent cd0fbe4941
commit 57205f91fe

View file

@ -1064,7 +1064,9 @@ func newstack() {
// recheck the bounds on return.)
if f := findfunc(gp.sched.pc); f.valid() {
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
}
}