[gclist] why malloc/free instead of GC?

Enrico Weigelt weigelt@metux.de
Tue, 18 Feb 2003 18:40:18 +0100


On Tue, Feb 18, 2003 at 08:27:55AM -0600, Charles Fiterman wrote:

<snip>
> Reference counting also has the advantage that the destruction of objects 
> can have rational finalizers. Finalizers must be safe, general, sure, 
> prompt and ordered. Safe means they don't violate the type system. General 
> means finalizers can run any code in the language and have that code 
> produce normal results, for example exceptions can't just get discarded. 
> Sure means if you build an object it gets to destroy itself. Prompt means 
> finalizers aren't indefinitely postponed. Ordered means finalizers run in a 
> determined order, if you ship the application you don't change the order 
> creating portability bugs.

reference counting is tricky if you're using ring structures.
if you use an 'clean' refcounting (_each_ time you're referencing, increase
the counter, and always decrease on dereference), you'll get dead chunks
which will never be freed, when using an ring structure.

cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux ITS 
 Webhosting ab 5 EUR/Monat.          UUCP, rawIP und vieles mehr.

 phone:     +49 36207 519931         www:       http://www.metux.de/     
 fax:       +49 36207 519932         email:     contact@metux.de
 cellphone: +49 174 7066481	     smsgate:   sms.weigelt@metux.de
---------------------------------------------------------------------
 Diese Mail wurde mit UUCP versandt.      http://www.metux.de/uucp/