Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!bu.edu!snorkelwacker.mit.edu!ai-lab!life!burley From: burley@pogo.ai.mit.edu (Craig Burley) Newsgroups: comp.object Subject: Re: Stash Collection Message-ID: Date: 28 Nov 90 17:09:50 GMT References: <2849@esquire.dpw.com> <1990Nov27.074534.17744@Think.COM> <2853@esquire.dpw.com> <2855@esquire.dpw.com> Sender: news@ai.mit.edu Organization: /home/fsf/burley/.organization Lines: 39 In-reply-to: lou@cs.rutgers.edu's message of 28 Nov 90 16:05:51 GMT In article lou@cs.rutgers.edu (lou) writes: In regard to memory that is accessible unless and until the space is needed for something else: there was a recent discussion on comp.lang.lisp of "weak" links (I think that was the term), which are links that can be followed to access some storage, but which do not make the collector think the storage is "in use". Thus, when garbage collecting, the storage looks like it can be reclaimed. (Of course, the garbage collector has to notice these weak links and reset them to NIL if to reclaims the storage they point to.) This has the advantage that the user does not have to write any special code to do the cleanup. -- Lou Steinberg uucp: {pretty much any major site}!rutgers!aramis.rutgers.edu!lou internet: lou@cs.rutgers.edu That sounds like a neat approach. But it doesn't appear to handle, without some changes, an approach I call (for lack of a decent education) the "explode/implode method". Here, information may be represented in a compacted or source fashion, such as a list of identifier names and pointers to their corresponding objects, and this is called "imploded form". For purposes of speed and other things, typically such a list is converted to, say, a hash table and other information, called "exploded form", which takes up more space. Keeping both forms around takes up even more space and is unecessary (especially if there's a copy of the imploded form on disk, but pretend there isn't). So perhaps the exploded form, once created, should have the only (and a weak) link to the imploded form so the imploded form gets gc'ed quickly and easily. Then if more space is needed, the exploded form somehow needs to be told to trash itself, and it should only do that if it either sees that it still has a weak link to its imploded sibling or if it can recreate its imploded sibling, after which it replaces any references to itself with references to its imploded sibling, and trashes itself. -- James Craig Burley, Software Craftsperson burley@ai.mit.edu