3 ms·
At least reference-counting is typically considered a form of garbage collection (e.g. using Rc<> or Arc<> in Rust, or std::shared_pointer in C++). Arguably, RA
by flohofwoe 2y ago
At least reference-counting is typically considered a form of garbage collection (e.g. using Rc<> or Arc<> in Rust, or std::shared_pointer in C++). Arguably, RAII calling destruction code at the end of a scope could also be considered garbage collection, the garbage is just very short lived ;)
I guess 'automatic memory management' is the less controversial term which covers both traditional GC and RAII, the downsides are very similar though.
- VWWHFSfQ 2y agoIt's different because the free() is deterministic, the instruction is encoded into the binary. Completely different than garbage collection where there is a whole runtime that has to periodically go figure out what can be safely deleted and what can't.