(no title)
CodeWithCoffee | 11 years ago
Not quite. Smart pointers do automatic reference counting, which doesn't use a garbage collector.
CodeWithCoffee | 11 years ago
Not quite. Smart pointers do automatic reference counting, which doesn't use a garbage collector.
srean|11 years ago
It is incomplete in the sense cycles are not collected, one would need extra machinery for those. It is also not great about throughput, a part of the problem is that it dirties the cache too much. Locking the count (or avoiding it somehow) is another issue. On the other hand for many use cases better latencies are achieved with reference counting than with alternative forms of garbage collection, (but this depends on use cases).
If runtime data cannot have have cycles, garbage is not created at a phenomenal rate and you are quite worried about GC pauses, then reference counting is often a cheap and effective solution.
Regardless, it sure is garbage collection.
DSingularity|11 years ago