Open mdempsky opened 6 years ago
Change https://golang.org/cl/99335 mentions this issue: cmd/compile: mark anonymous receiver parameters as non-escaping
This looks fixed. Any problems with closing?
This is half fixed. (*T).M(&t)
and (*T).N(&t)
still escape.
Still for 1.11, or do we put off to 1.12?
Doesn't this have the obvious user workaround of applying the local purely local rewrite of (*T).M(&t)
into (&t).M()
, which can actually be written t.M()
?
I'd like to postpone this to unplanned.
Still an issue with newescape.
Change https://golang.org/cl/248217 mentions this issue: cmd/compile: mark receiver in indirect calls as non-escaping
Compiling the above code with "go tool compile -m" outputs:
This doesn't happen if the receiver parameters are given a proper name, or if the receiver parameters are turned into normal parameters (i.e., changing the methods into functions).
The direct calls (
t.M()
andt.N()
) are because(*EscState).esctag
's unnamed parameter loop only touchesfn.Type.Params()
, notfn.Type.Recvs()
.The indirect calls (
(*T).M(&t)
and(*T).N(&t)
) appear to be because esc.go just doesn't look for esc tags for methods called as functions.