3 ms·
You write programs so short and uncomplex that you rarely need to free memory?
by post-it 5y ago
You write programs so short and uncomplex that you rarely need to free memory?
- pwdisswordfish8 5y agoEver heard of RAII?
- maleldil 5y agoThat's still memory management, because you need to worry about lifetimes.
- hiptobecubic 5y agoYou only need to worry that data that you need doesn't go out of scope.
- ncmncm 5y agoIt is automated, not manual, memory management. Just not GC.
- BenjiWiebe 5y agoI interpret it as meaning they don't use dynamic memory allocation.
- ncmncm 5y agoFalse. Use of dynamic memory allocation without GC, without reference-counting (which is GC) and without manual memory management is the usual practice in C++ and Rust. Reference-counting GC is available when it is not too costly, which is common, and more convenient, which is rare. Ordinary automatically-generated destructors handle almost everything, almost all the time. Once in a great while, performance demands a concession such as an arena allocator, which also is not "manual memory management", and also not GC, and is radically cheaper than either one.