Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!usc!apple!lins From: lins@Apple.COM (Chuck Lins) Newsgroups: comp.sys.mac.programmer Subject: Re: Memory Manager Garbage Collector? Message-ID: <40785@apple.Apple.COM> Date: 7 May 90 15:52:08 GMT References: <1990Apr29.154439.12596@aucs.uucp> <40634@apple.Apple.COM> <54471@microsoft.UUCP> Organization: Apple Computer Inc, Cupertino, CA Lines: 30 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 In automatic storage management systems, the programmer never calls any routine to explicitly release memory back to the system. Calling HPurge does not make it garbage collection in the traditional sense of the word. Plus, it doesn't work for pointers (eg grafports). -- Chuck Lins | "Is this the kind of work you'd like to do?" Apple Computer, Inc. | -- Front 242 20525 Mariani Avenue | Internet: lins@apple.com Mail Stop 37-BD | AppleLink: LINS@applelink.apple.com Cupertino, CA 95014 | "Self-proclaimed Object Oberon Evangelist" The intersection of Apple's ideas and my ideas yields the empty set.