cmd/compile: non-inlineable allocating function in closure causes closure to allocate #25769
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
It appears that inside a closure, if a function cannot be inlined and that function allocates, the closure will be allocated. This may be as intended (if so, sorry!), but it feels as if allocations in functions inside closures should be an orthogonal concern to the allocation of the closure itself.
What version of Go are you using (
go version
)?go version devel +ca8ec69ce6 Wed Jun 6 19:20:12 2018 +0000 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
https://play.golang.org/p/5brgC6eRn-c (more representative)
https://play.golang.org/p/A0-tIgewmhU (more minimal, in return position)
https://play.golang.org/p/0bg2yuZA6gc (more minimal, in middle of func)
What did you expect to see?
No
func literal escapes to heap
ingo build -gcflags '-m -m' foo.go
What did you see instead?
For the first play link:
The text was updated successfully, but these errors were encountered: