Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!mips!apple!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: HandleObject vs. 5+ meg of RAM and Virtual Memory Message-ID: <9035@goofy.Apple.COM> Date: 7 Jul 90 01:07:15 GMT References: <279@unf7.UUCP> <1990Jul6.190245.5781@agate.berkeley.edu> Organization: Apple Computer, Inc. Lines: 25 In article <1990Jul6.190245.5781@agate.berkeley.edu> lippin@math.berkeley.edu writes: > >Of course, you do need HandleObjects and PascalObjects for dealing >with MacApp, and they're handy for classes you really want to store >that way. Just don't think every object has to be one. In general, most of the objects created by an application are application-specific, which means you can use any kind of C++ object. You only have to use PascalObjects when you are interfacing with MacApp. I agree with you about the use of stack-based objects. Not only don't you fragment the heap, but you also don't pay the memory allocation cost, and you don't have to worry about freeing them. Lastly, it is important to remember that you can override operator new for a certain class, and take over the allocation of the storage yourself. You can use this to place groups of objects in a handle, for example. (See develop issue #2.) -- Larry Rosenstein, Object Specialist Apple Computer, Inc. 20525 Mariani Ave, MS 46-B Cupertino, CA 95014 AppleLink:Rosenstein1 domain:lsr@Apple.COM UUCP:{sun,voder,nsc,decwrl}!apple!lsr