Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!corton!ilog!barbes!davis From: davis@barbes.ilog.fr (Harley Davis) Newsgroups: comp.lang.c++ Subject: Re: Implementing LISP in C++ (type discrimination) Message-ID: Date: 22 Apr 91 08:55:07 GMT References: <1991Mar8.024331.14235@searchtech.com> <27D7F621.2F5@tct.uucp> <17238@cadillac.CAD.MCC.COM> <1991Mar12.221015.22144@aero.org> <14342@hacgate.UUCP> <1991Apr17.233653.25149@dsd.es.com> Sender: davis@ilog.fr Organization: ILOG S.A., Gentilly, France Lines: 26 In-reply-to: bpendlet@bambam.dsd.es.com's message of 17 Apr 91 23:36:53 GMT In article <1991Apr17.233653.25149@dsd.es.com> bpendlet@bambam.dsd.es.com (Bob Pendleton) writes: It's called reference counting. It's been used since the dawn of time. Reference counting usually uses more total time than traditional garbage collection. The other cost of reference counting is the storage used by the count associated with each object. One of the most important problems with reference counting is that it doesn't collect all the garbage. In particular, circular data structures never get collected. Consider the following program: (defvar *some-list* '(a b)) (setf (cddr *some-list*) *some-list*) (setf *some-list* ()) Now, despite the fact that there is no way to access any of the cells in *some-list*, all of them have a reference count of 1. Oops. -- Harley Davis -- ------------------------------------------------------------------------------ nom: Harley Davis ILOG S.A. net: davis@ilog.fr 2 Avenue Gallie'ni, BP 85 tel: (33 1) 46 63 66 66 94253 Gentilly Cedex, France