Skip to content

Commit 35e6b8a

Browse files
eliasnaurdeadprogram
authored andcommitted
compileopts: lower "large stack" limit to 16kb
I'm running with `-stack-size 16kb` and running into excessive allocations because the otherwise non-escaping buffer in https://github.com/golang/go/blob/c53cb642deea152e28281133bc0053f5ec0ce358/src/crypto/internal/fips140/sha512/sha512block.go#L97 is moved to the heap.
1 parent 8a31ae1 commit 35e6b8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compileopts/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func (c *Config) StackSize() uint64 {
226226

227227
// MaxStackAlloc returns the size of the maximum allocation to put on the stack vs heap.
228228
func (c *Config) MaxStackAlloc() uint64 {
229-
if c.StackSize() > 32*1024 {
229+
if c.StackSize() >= 16*1024 {
230230
return 1024
231231
}
232232

0 commit comments

Comments
 (0)