Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!aplcen!uakari.primate.wisc.edu!paz.geology.wisc.edu!uwvax!rang From: rang@cs.wisc.edu (Anton Rang) Newsgroups: comp.sw.components Subject: Re: Real-time Garbage Collection Message-ID: Date: 18 Sep 89 21:05:02 GMT References: <1895@hydra.gatech.EDU> <6493@hubcap.clemson.edu> Sender: news@spool.cs.wisc.edu Organization: UW-Madison CS department Lines: 23 In-reply-to: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu's message of 18 Sep 89 17:41:43 GMT In article <6493@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) writes: >From article <1895@hydra.gatech.EDU>, by tynor@prism.gatech.EDU (Steve Tynor): >> Freeing the memory _is_ usually straightforward. Knowing when it's safe to >> do so _isn't_. That's when GC (or reference counting) becomes necessary. > > It's safe to do so: > > 1) When the variable goes out of scope > > 2) When the programmer specifies that it's to be destroyed sooner. If there's any explicit pointer manipulation, these conditions aren't sufficient, because an object can be pointed to in more than one place. For instance, if I have two objects (A and B) sharing pointers to object X, then object X should be destroyed (assuming no other references) when both A and B have been destroyed. Personally, I prefer controlling my own data structures...leaving it up to a garbage collector has always seemed a little sloppy to me. +----------------------------------+------------------+ | Anton Rang (grad student) | "VMS Forever!" | | University of Wisconsin--Madison | rang@cs.wisc.edu | +----------------------------------+------------------+