3 ms·
"No, reference counting is commonly seen as a specific implementation of garbage collection" Shared pointers provide the reference counting, but reference coun
by fsloth 9y ago
"No, reference counting is commonly seen as a specific implementation of garbage collection"
Shared pointers provide the reference counting, but reference counting alone hardly constitutes a garbage collector because it doesn't collect all of the garbage.
For example, shared_ptr:s alone do not automatically detect and collect cycles.
- pjmlp 9y agoChapter 5 of The Garbage Collection Handbook. http://gchandbook.org/ http://gchandbook.org/
- jerf 9y agoThe dirty secret of the "garbage collection vs. manual memory management" war is that there isn't actually a bright shining line to be drawn anywhere; it's actually a relatively smooth continuum ranging on the one end from statically allocating all values up front (in the style of embedded system) to the dynamic languages on the other end, with dozens of stops in between.