You are probably saying to yourself "Bury the lead much?" Heh. The thing is, it is really crucial to understand how storing values in an interface and escape analysis works in order to make sense of why sometimes it is possible to store a value in an interface that escapes to the heap...and does not need any new memory to do so.
Say what!?
Yep, you heard me...magic. Okay, not really, but it is due to something about which I certainly had no clue until diving down this rabbit hole. This section reviews:
- Shut up and prove it: an example of when this situation will occur
- Looking at the assembly: looking closely at why this happens
- When it will happen?: all the scenarios where we won't see mallocs
- Overall impact: what is the impact of this behavior?
Next: Shut up and prove it