Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!dlyons From: dlyons@Apple.COM (David A. Lyons) Newsgroups: comp.sys.apple2 Subject: Re: Handles Re: Handle Dereferencing (was Re: Q: Orca/C and SFMultiGet2) Message-ID: <47562@apple.Apple.COM> Date: 22 Dec 90 19:00:24 GMT References: <18830@netcom.UUCP> <1990Dec15.080751.20819@ee.ualberta.ca> <1990Dec22.041312.347@ddsw1.MCS.COM> Organization: Apple Computer Inc., Cupertino, CA Lines: 29 In article <1990Dec22.041312.347@ddsw1.MCS.COM> zane@ddsw1.MCS.COM (Sameer Parekh) writes: > > Why DO handles exist? Why can't one just use the pointers? >(I am learning programming now. . .) > >-- >zane@ddsw1.MCS.COM Handles exist so that after you allocate lots of hunks of memory, dispose of a lot of them, allocate more of different sizes, etc, you don't have to be stuck with all the weird-sized "holes" between hunks. By having handles, the Memory Manager can move many memory block around to consolidate the free space into bigger chunks, and whoever allocated those memory blocks can still get at them, because they have a handle. (Each handle points to a "master pointer," which never moves. The master pointer *changes* when the block gets moved.) Read the Memory Manager chapter in Toolbox Ref Volume 1! -- David A. Lyons, Apple Computer, Inc. | DAL Systems Apple II System Software Engineer | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie: D.LYONS2 or DAVE.LYONS CompuServe: 72177,3233 Internet/BITNET: dlyons@apple.com UUCP: ...!ames!apple!dlyons My opinions are my own, not Apple's.