Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!apple!usc!ucsd!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: ARRGH (Strings and things) Message-ID: <8852@hoptoad.uucp> Date: 31 Oct 89 02:33:32 GMT References: <16004@netnews.upenn.edu> <8835@hoptoad.uucp> <16420@dartvax.Dartmouth.EDU> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 26 In article <8835@hoptoad.uucp>, tim@hoptoad.uucp (Tim Maroney) writes: > BlockMove doesn't touch the heap so it's safe to use this dereference > even when mystringhandle is unlocked or purgeable (but not purged!) In article <16420@dartvax.Dartmouth.EDU> Jim.Matthews@dartmouth.edu writes: >A paranoid note: BlockMove doesn't move memory, but since it's an OS trap >most compilers get to it through glue. If that glue is in an unloaded >segment, then the act of *calling* BlockMove will move memory. Excellent point. >The moral: watch out for traps that require glue or put the glue in a >segment that is never unloaded. I get a different moral out of this -- don't unload segments. I use so many function pointers in my code that it's impossible anyway, so I don't have this problem. As far as I'm concerned, UnloadSeg was relevant only to the Mac 128K.... Another moral -- if you *do* unload segments, then link your glue routines into the main code segment, so they will never be unloaded. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com These are not my opinions, those of my ex-employers, my old schools, my relatives, my friends, or really any rational person whatsoever.