• Austin Clements's avatar
    runtime: fix stackCache=0 debug mode · 47542520
    Austin Clements authored
    Setting stackCache to 0 to disable stack caches for debugging hasn't
    worked for a long time. It causes stackalloc to fall back to full span
    allocation, round sub-page stacks down to 0 pages, and blow up.
    
    Fix this debug mode so it disables the per-P caches, but continues to
    use the global stack pools for small stacks, which correctly handle
    sub-page stacks. While we're here, rename stackCache to stackNoCache
    so it acts like the rest of the stack allocator debug modes where "0"
    is the right default value.
    
    Fixes #17291.
    
    Change-Id: If401c41cee3448513cbd7bb2e9334a8efab257a7
    Reviewed-on: https://go-review.googlesource.com/43637Reviewed-by: default avatarKeith Randall <khr@golang.org>
    47542520
stack.go 34.7 KB