Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!mimsy!mojo!russotto From: russotto@eng.umd.edu (Matthew T. Russotto) Newsgroups: comp.sys.mac.programmer Subject: Re: StripAddress() question Message-ID: <1990Nov19.211544.26524@eng.umd.edu> Date: 19 Nov 90 21:15:44 GMT References: <90323.102417CXT105@psuvm.psu.edu> Sender: news@eng.umd.edu (The News System) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 39 In article <90323.102417CXT105@psuvm.psu.edu> CXT105@psuvm.psu.edu (Christopher Tate) writes: >Do I need to call StripAddress() in the following situation? Here's the >relevant code: > >Handle myHand; >unsigned char *myPtr; > >myHand = NewHandle(AMOUNT); >HLock(myHand); >myPtr = StripAddress(*myHand); /* <-- do I need to do this? */ >/* Now, put stuff into the block, using and incrementing myPtr */ > >Do I need to call StripAddress(*myHand) to make sure I get a valid >pointer into the block? I *think* I do, because the master pointer >might have strange stuff in it, but I'm not sure, and the tech note >isn't too clear on this.... No. Not in this case. What will happen here is IF 32-bit memory manager is running THEN no garbage in master ptr ELSE (24 bit memory manager) garbage is ignored by MMU. You would need it if you put the MMU in 32 bit mode when under a 24-bit memory manager, i.e. Handle myHand; unsigned char *myPtr; extern Ptr hugebitmap /* 32-bit pointer into NuBus address space */ myHand = NewHandle(AMOUNT); HLock(myHand); myPtr = StripAddress(*myHand); oldmmumode = SwapMMUMode(32bitconstantwhateverthatis); BlockMove(hugebitmap, myHand, amount); SwapMMUMode(oldmmumode); -- Matthew T. Russotto russotto@eng.umd.edu russotto@wam.umd.edu .sig under construction, like the rest of this campus.