4 ms·
I don't think Go lets you take stack addresses. If you try to do that, it will copy the data structure onto the heap.
by jganetsk 15y ago
I don't think Go lets you take stack addresses. If you try to do that, it will copy the data structure onto the heap.
- enneff 15y agoThe compiler is free to optimize this how it sees fit. Taking the address of a value doesn't necessarily move it to the heap.