Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!mintaka!olivea!samsung!uakari.primate.wisc.edu!unmvax!pprg.unm.edu!topgun!mustang!nntp-server.caltech.edu!tybalt.caltech.edu!woody From: woody@tybalt.caltech.edu (William Edward Woody) Newsgroups: comp.sys.mac.programmer Subject: Re: NewHandle(0L) ? Message-ID: <1990Oct19.163128.28079@nntp-server.caltech.edu> Date: 19 Oct 90 16:31:28 GMT References: <32600007@inmet> <1990Oct19.151254.8197@ux1.cso.uiuc.edu> Sender: news@nntp-server.caltech.edu Organization: JPL Computer Graphics Laboratory, Pasadena Lines: 30 Nntp-Posting-Host: tybalt.caltech.edu In article <1990Oct19.151254.8197@ux1.cso.uiuc.edu> scott@scotty (Scott Howard) writes: >Why call a handle up before you need to? If you >pre-allocate it with 0L, you lose the advantage of being >able to tuck it into an unobtrusive corner of your application's >heap. At any rate, It ought to work as long as you don't try >disposing it. No cigar; spin again. If you allocate a handle with size zero, and leave it unlocked, the OS shouldn't have any problems moving the object around to an unobtrusive area in your heap if need be; this is the reason why you use handles instead of pointers. If you allocate a handle with zero size, you will eventually need to dispose it again in order to release the master pointer (if for no other reason). Manipulating handles with size 0 is like manipulating handles with any other size; size 0 handles are just smaller, that's all. BTW, handling 0 size pointers in the Macintosh memory manager model is just like pointers of larger size, except that the size 0 pointers are smaller. -- William Edward Woody | Disclamer: USNAIL P.O.Box 50986; Pasadena, CA 91115 | EMAIL woody@tybalt.caltech.edu | The useful stuff in this message ICBM 34 08' 44''N x 118 08' 41''W | was only line noise.