4 ms·
Whatever, there are still drop flags (on the stack instead, sure), and still dynamic runtime checks for drops. The points I was making is that 'zero cost' memo
by shadowmint 12y ago
Whatever, there are still drop flags (on the stack instead, sure), and still dynamic runtime checks for drops.
The points I was making is that 'zero cost' memory management isn't 100% zero cost. The drop checker does incur some basic dynamic runtime costs.
To be 'zero cost' drop behaviour would be determined at compile time.
- dbaupp 12y agoThe behaviour is determined at compile time, with runtime cost only introduced if it is absolutely needed (when one branch drops, and another doesn't), and, even then, it can be avoided, by manually forcing a drop of the value in every branch.