1
0
mirror of https://github.com/golang/go synced 2024-11-11 21:50:21 -07:00

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
}
}