3 ms·
Yes, something is managing my memory. Just not GC, and not reference counting (which is also GC). As I said. C++ has destructors, and owning pointers (called "
by ncmncm 5y ago
Yes, something is managing my memory. Just not GC, and not reference counting (which is also GC). As I said.
C++ has destructors, and owning pointers (called "unique_ptr"), and also arena allocators for when those are useful. Rust has its Drop trait and analogs of the other things. (Use of arenas with Rust standard library containers is approaching maturity.) They make memory management automatic and wholly painless. Both languages offer reference-counted GC for places where that is helpful, but such places are rare, and where used typically burn an unmeasurably small fraction of runtime, with no "pauses".
- avianlyric 5y agoUsing destructors just reference counting done the hard way. > burn an unmeasurably small fraction of runtime That’s also known as a very short pause.