Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!uwmcsd1!leah!itsgw!batcomputer!pyramid!voder!apple!tecot From: tecot@apple.UUCP (Ed Tecot) Newsgroups: comp.sys.mac Subject: Re: What does access memory manager' mean? Message-ID: <6471@apple.UUCP> Date: Tue, 13-Oct-87 18:39:57 EDT Article-I.D.: apple.6471 Posted: Tue Oct 13 18:39:57 1987 Date-Received: Thu, 15-Oct-87 06:34:27 EDT References: <5365@jade.BERKELEY.EDU> <10620001@hpfclm.HP.COM> <1319@cartan.Berkeley.EDU> Reply-To: tecot@apple.UUCP (Ed Tecot) Organization: Apple Computer Inc., Cupertino, USA Lines: 29 In article <1319@cartan.Berkeley.EDU> lippin@spam.UUCP (tom lippincott) writes: >But wait, there's more! > >Even calls that don't change the heap can cause problems -- most quickdraw >routines, in particular, are not reentrant. If you make a quickdraw call >while the main program is making one, you'll probably mess up that call. >(I've tried this. The bugs are Mostly Harmless, but there.) No, that's not true. What you are experiencing is completely different: Someone else has already explained that an interrupt can interrupt just about anything, including heap compaction. Of course you don't want to make any memory manager calls at this time, since that could cause heap corruption. However, you also don't want to reference ANY unlocked relocatable blocks, as they could be "in transit". Quickdraw regions are by definition relocatable. So it follows that you don't want to make any quickdraw calls that affect regions. However, every grafPort contains two regions, a clipRgn and a visRgn. So, you don't want to make any quickdraw calls that uses a grafPort. It turns out that only two useful calls remain: CopyBits and CopyMask. But beware: These calls check to see if the destination (pix or bit)Map is the same as that of the current grafPort, and if so, uses the grafPort's clipping. So, in effect, these calls are only useful if the destination is an offscreen (pix or bit)Map. In summary, QuickDraw is reentrant, but it's dependency upon the memory manager precludes its use during interrupt time. _emt