Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!uunet!mcsun!ukc!slxsys!ibmpcug!bill From: bill@ibmpcug.co.uk (Bill Birch) Newsgroups: comp.lang.lisp,connect.audit Subject: Re: Memory Management in Lisp? Message-ID: <1991Feb20.150947.2039@ibmpcug.co.uk> Date: 20 Feb 91 15:09:47 GMT Organization: The IBM PC User Group, UK. Lines: 28 > An interesting idea, but potentially very dangerous. An object may have > references that the application isn't aware of. For instance, the user > could have assigned an object to a global variable while in the debugger. > Or in a Dynamic Windows or CLIM environment, just printing out the object > creates a new reference to the object from the window's output history > structure. > This is a function of the way garbage collection is arranged. A mark- sweep system has problems with the above.However, in a reference- counting LISP system, the total number of references to any object is known by definition. Thus it is possible to allow the application to garbage collect explicitly. For example I have an interpreter that allows the programmer to read the reference count of an object. Also , to force collection of an unused tree hanging off a symbol can simply be done by : (SETQ FOOBAR NIL) Since the reference count on the contents of FOOBAR will have dropped to zero, the memory is automatically reclaimed. Bill -- Automatic Disclaimer: The views expressed above are those of the author alone and may not represent the views of the IBM PC User Group. --