What is 4*PtrSize extra space on goroutine stack for?

113 views
Skip to first unread message

peng.g...@gmail.com

unread,
Jul 12, 2021, 3:32:09 AM7/12/21
to golang-nuts
In the code https://github.com/golang/go/blob/master/src/runtime/proc.go#L4317, there is a 4*PtrSize extra space. What is the purpose?

Keith Randall

unread,
Jul 12, 2021, 10:49:47 PM7/12/21
to golang-nuts
I'm not sure it is necessary. The intent is to make sure we don't access off the top of the stack. sys.MinFrameSize should really handle that, I think. My guess is that the 4*sys.PtrSize was from before we had the MinFrameSize concept defined.
Reply all
Reply to author
Forward
0 new messages