4 ms·
It at least eliminates what I'd estimate to be the most common cause of memory leaks (in C): missing a free. Which is the same guarantee that GCs provide.
by ben-schaaf 9y ago
It at least eliminates what I'd estimate to be the most common cause of memory leaks (in C): missing a free. Which is the same guarantee that GCs provide.
- oconnor663 9y agoThe story is similar to C++. Almost all allocations are done by types that'll automatically call free in their destructors. But because there's no global GC, it's still possible to leak accidentally by creating a cycle in reference-counted smart pointers.
- fnord123 9y agoThere is still the other most common source of memory leaks: putting data into long living (e.g. 'static) hash tables and having no plan for pruning it.