Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: Setting up multiple heaps Message-ID: <2533@husc6.harvard.edu> Date: 30 Aug 89 05:10:41 GMT References: <9878@phoenix.Princeton.EDU> <194@dbase.UUCP> <2299@goanna.oz> <13365@well.UUCP> <21673@cup.portal.com> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec Language Products Group Lines: 42 In article <21673@cup.portal.com> Andrew_James_Peterson@cup.portal.com writes: > >I'm going to try to set up an application that uses multiple heaps. OK, but why? Setting up a new heap zone is pretty simple: var hcZone: THz; procedure Heap; var oldzone: THz; begin OldZone := GetZone; hcZone := THz(NewPtr(MaxZoneSize)); InitZone(nil, 16, Ptr(Ord4(hcZone) + MaxZoneSize), Ptr(hcZone)); SetZone(OldZone); end; To make your new zone the current zone, do a SetZone(hcZone); Multiple heaps generally aren't required, unless you're THINK Pascal or you want to perform some action on your own heap which requires blocks to be allocated, and you don't want to affect your own heap. R. ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "There is no personal problem which cannot be solved by sufficient application of high explosives." ~~~~~~~~~~~~~~~