Skip to content

Conversation

eliasnaur
Copy link
Contributor

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.

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.
@aykevl
Copy link
Member

aykevl commented Oct 11, 2025

@dgryski do you have an opinion on this? (Since you introduced this heuristic).

@deadprogram
Copy link
Member

Maybe @dankegel has opinion on this?

@dgryski
Copy link
Member

dgryski commented Oct 21, 2025

Sorry, was away from GitHub for a bit. Don't remember how I came up with that number -- it may have come from something in the standard library (zip?). I'm fine to tweak it but obviously having it configurable would also be handy.

@deadprogram
Copy link
Member

I'm fine to tweak it but obviously having it configurable would also be handy.

That could be a follow-on PR, perhaps? In any case, let us merge this one.

Thanks everyone!

@deadprogram deadprogram merged commit 35e6b8a into tinygo-org:dev Oct 22, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants