Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: escape analysis too pessimistic for value-captures at closure evaluation. #17388
I think this results from a very simple model of closure behavior; anything captured is regarded as transmitted to any result, regardless of the actual behavior of the closure.
It is plausible that the escape behavior of closures could be modeled in the same way as the escape behavior for ordinary functions, with captured-by-value parameters treated equivalently.