Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bu.edu!bu-it!odell From: odell@bu-it.bu.edu (Jim O'Dell) Newsgroups: comp.sys.mac.programmer Subject: Re: Memory Manager Garbage Collector? Message-ID: <56839@bu.edu.bu.edu> Date: 6 May 90 14:57:03 GMT References: <1990Apr29.154439.12596@aucs.uucp> <40634@apple.Apple.COM> <54471@microsoft.UUCP> Sender: news@bu.edu.bu.edu Reply-To: odell@bu-it.bu.edu (Jim O'Dell) Followup-To: comp.sys.mac.programmer Organization: Information Technology, Boston University, Boston, MA, USA Lines: 27 In article <54471@microsoft.UUCP> earleh@microsoft.UUCP (Earle R. Horton) writes: >In article <40634@apple.Apple.COM> lins@Apple.COM (Chuck Lins) writes: >>In article <1990Apr29.154439.12596@aucs.uucp> ifocs9d@aucs.uucp > (Rick Giles) writes: >>>What is the underlying algorithm used by the Memory Manager garbage >>>collector? Is it a variant of mark-and-sweep? >... >>The Memory Manager does not garbage collect. It may compact the heap (at >>certain well-defined times). The programmer must explicitly call DisposPtr >>and/or DisposHandle as appropriate. > > You can mark relocatable blocks as purgeable using HPurge, and you >can get the Memory Manager to get rid of them using PurgeMem. This looks >an awful lot like garbage collection to me! > >Earle R. Horton Garbage collection is a technical term for a process by which a program or operating systems discovers all by itself which memory is useful and which memory can be safely be disposed of. This process works by following all the pointers in the the machine. To do this you need to be able to distinguish pointers from ints and to be able to tell the size of objects. This is why Lisp, smalltalk and other object oriented languages with garbage collection have run time typing. Jim O'Dell