Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!cmcl2!rutgers!labrea!decwrl!pyramid!voder!apple!lsr From: lsr@apple.UUCP (Larry Rosenstein) Newsgroups: comp.sys.mac Subject: Re: TextEdit error checking Message-ID: <1445@apple.UUCP> Date: Thu, 6-Aug-87 18:57:57 EDT Article-I.D.: apple.1445 Posted: Thu Aug 6 18:57:57 1987 Date-Received: Sat, 8-Aug-87 14:48:30 EDT References: <8654@ut-sally.UUCP> <2651@husc6.UUCP> Reply-To: lsr@apple.UUCP (Larry Rosenstein) Organization: Advanced Technology Group, Apple Computer Lines: 41 Keywords: Running Out of Memory In article <2651@husc6.UUCP> stew@endor.UUCP (Stew Rubenstein) writes: > >If the GrowZone gets called, and the buffer has already been deallocated, >my program issues prayers to Hertzfeld, Atkinson, and the Woz, unloads >every segment but CODE 1 (where the main program, the growzone function, >and all functions needed to save files reside), saves the user's documents >in filenames like "Budget Worksheet (save1)", and ExitToShell(). My >ResumeProc calls the same function (you gotta SetupA5 and >UseResFile(myAppFile) first). I hope you use the Prayer Manager to be sure that you are compatible with future systems! (:-) Alternatively, you can keep another reserve block in memory which is the maximum memory you need to operate the essentials of your application. This means enough memory to clear things from a document, save documents, quit, etc. When your initial reserve is deallocated, you have to prevent the user from increasing the memory usage of the application (eg, by disabling commands). Because you have reserved the other memory, however, the user should be able to save the documents normally and regain some memory. This is a very simplified description of what we do in MacApp to solve this problem. One of the trickier details involves how to manage this second reserve block so that memory is used effectively. For example, an unlocked code segment in memory is just as effective in reserving essential application space because it can be purged at any time. Therefore, you can reduce the reserve handle size by the size of all the unlocked code segments. -- Larry Rosenstein Object Specialist Apple Computer AppleLink: Rosenstein1 UUCP: {sun, voder, nsc, mtxinu, dual}!apple!lsr CSNET: lsr@Apple.com