[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gc and deallocation

In article <...> bill@cambridge.apple.com (Bill St. Clair) writes:
 > At 10:40 PM 1/4/94 -0500, Robert Bruce Findler wrote:
 >>What happens to memory that is allocated in a clos object when the
 >>object is gc'ed? Is there a method that should be defined to clean-up
 >>after the object? Some sort of deallocate-instance?
 > When a CLOS object is garbage collected, it's memory is freed for reuse.
 > The memory of the objects in its slots will also be freed if those objects
 > are not referenced by any other live objects. MCL's garbage collector
 > does not support an explicit user-specifiable clean-up procedure.
 > You normally don't need one, though some applications, e.g. persistent
 > object databases, can benefit from such a feature.

I would imagine that if you have pointers into the Macintosh heap that
were stored in the CLOS object you would end up with a memory leak if
you didn't have some disposal routine of your own.  If you do this, then
you will need to explicitly deallocate the Macintosh heap memory.
Thomas A. Russ,  USC/Information Sciences Institute          tar@isi.edu    
4676 Admiralty Way, Marina del Rey, CA 90292          (310) 822-1511x775