News for hackers. Stuff that matters.
Re:Why use garbage collection by zandorg on Friday January 23, 2009 @06:14PM (#447349)
The purpose of the reference count is to only deallocate memory once. You create it (copy constructor, count = 1), you pass it to a function (count = 2), come out of the function (destructor, count = 1) and finally return from the original function (count = 0, deallocate). It's like passing a hashtable around in Lisp - it doesn't pass a copy, it passes a pointer, and thus is more efficient on memory usage and speed.

There are no comments on this comment yet.