Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!claris!outpost.UUCP!peirce From: peirce@outpost.UUCP (Michael Peirce) Newsgroups: comp.sys.mac.programmer Subject: Re: MacApp memory mgmt with Callbacks Message-ID: <0B010004.8rxt4d@outpost.UUCP> Date: 27 Mar 91 16:53:10 GMT Reply-To: peirce@outpost.UUCP Organization: Peirce Software Lines: 28 X-Mailer: uAccess - Mac Release: 1.0.3 In article <4637@dftsrv.gsfc.nasa.gov>, rdominy@kong.gsfc.nasa.gov (Robert Dominy) writes: > > I'm having trouble with using callback/completion routines for > MacTCP under MacApp. It seems that under the MacApp memory > management, it is possible that the segment in which my callback > routines are defined can be periodically unloaded. This of course > kills the program if any such routine is invoked. > > What is the proper way of telling MacApp that a Code seqment should > be resident in memory and should not be unloaded? I tried defining > my own 'seg!' resource as described in the reference manual, but this > did not seem to help. I was able to define the callback routines as > being in one of MacApp's resident segments (GDebug) which seemed > to work. I think you want to define a 'res!' resource, rather than (or in addition to?) a 'seg!' resource for resident segements. You could also just use one of the predefined resident segments like MARes ({$S MARes}), though your choice of GDebug might cause problems if you build a non-debug version. -- michael -- Michael Peirce -- outpost!peirce@claris.com -- Peirce Software -- Suite 301, 719 Hibiscus Place -- Macintosh Programming -- San Jose, California 95117 -- & Consulting -- (408) 244-6554, AppleLink: PEIRCE