cmd/compile: unnecessarily moving variables into heap when using goroutine #33216
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Performance
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/VeUzT10cew9
What did you expect to see?
Variable c can be allocated on stack because lifetime of the new goroutine is shorter than the main goroutine.
What did you see instead?
The text was updated successfully, but these errors were encountered: