From: Kin-Wing Edwin Lee
Subject: Take charge of Garbage Collection in Lisp
Date: 
Message-ID: <3268bc$p1c@news.nynexst.com>
Is there any way to do your own garbage collection in Common Lisp?

Thank you,

Edwin
-- 
    Kin-Wing Edwin Lee                      Network Planning & Engineering Lab
    ·····@nynexst.com                       NYNEX Science & Technology Inc
    (914)644-2386                           500 Westchester Avenue
    Fax:(914)644-2404                       White Plains, NY 10604

From: William Paul Vrotney
Subject: Re: Take charge of Garbage Collection in Lisp
Date: 
Message-ID: <vrotneyCu9C2n.GtE@netcom.com>
In article <··········@news.nynexst.com> ·····@nynexst.com (Kin-Wing Edwin Lee) writes:
>
>   Is there any way to do your own garbage collection in Common Lisp?
>

Not by the language definition. However most implementations (see for
example Franz Inc. Allegro CL) provide special GC functions for doing this
and setting GC parameters.

Also there are techniques for controlling garbage generation so that your
program will almost never or never have to do an auto GC. For example
"caching of objects": If you define an object, say a struct FOO then instead
of programming

        (make-foo ...)

you program

        (new-foo ...)

where NEW-FOO looks at a list of deleted FOOs and pops one off for a return
value of NEW-FOO or does a MAKE-FOO if the list is empty.  In other words
there is always only a cache of FOOs or in-use FOOs but never any garbage
FOOs.  A DELETE-FOO function would push a FOO that was done with back onto
the list. One could even go so far as having a list of unused CONSes. I have
seen programs that had to generate enormous amounts of garbage between
cycles and by using these techniques the growth rate of the heap approached
zero.

Warning. If you use the above technique be careful about initialization of
object slots.

-- 
Bill Vrotney - ·······@netcom.com
From: Peter Dudey
Subject: Re: Take charge of Garbage Collection in Lisp
Date: 
Message-ID: <DUDEYP.94Aug9084923@hume.cs.orst.edu>
In article <··········@news.nynexst.com> ·····@nynexst.com (Kin-Wing Edwin Lee) writes:

   Is there any way to do your own garbage collection in Common Lisp?

I think it might be implementation-dependent;  I know Lucid Common
Lisp has a function or two to explicitly call the garbage collector.

Also, check out the dynamic-extent declaration, on page 232 of CLtL2.

-- 
····························@research.cs.orst.edu______________________________
Peter Dudey		Peter Drake		/  Master's student in Comp Sci
257 NE 13th	  ==>	279D SE Lilly		\   (Artificial Intelligence)
Salem, OR  97301	Corvallis, OR  97333	/    Oregon State University
~~~~~~~~~~~"I enjoy research more than eating."  - Curt Richter~~~~~~~~~~~~~~~~