cmd/compile: reuse allocated value in interface #23677
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
Consider the following snippet:
This prints:
On every iteration, it is calling
runtime.convT2Estring
. It should be able to figure out that theruntime.eface._type
is identical and also a non-pointer kind. In that situation, it should be able to just reuse that previously allocated value.This should be safe, since Go does not allow you to take the address of a interface value:
Thus, nothing else should be referencing the underlying value (unless unsafe was used).
The text was updated successfully, but these errors were encountered: