Path: utzoo!attcan!uunet!decwrl!adobe!jholt From: jholt@adobe.COM (Joe Holt) Newsgroups: comp.sys.mac.programmer Subject: Re: ThinkC's handling of CODE resources. Message-ID: <3806@adobe.UUCP> Date: 11 Jul 90 16:12:31 GMT References: <1990Jul10.150057.24765@hod.uit.no> Reply-To: jholt@adobe.com (Joe Holt) Organization: Adobe Systems Incorporated, Mountain View, CA Lines: 15 Code resources are never unlocked unless you explicitly UnloadSeg(). Even in such a case, as soon as code begins executing in that segment, it is locked down and stays locked until another UnloadSeg() -- again, explicitly by you. It would be disastrous if code segments could move around between calls with no OS support! Remember, tho', that unlocked handles may move. Be careful passing a dereferenced handle which is unlocked to a routine in another segment. Even if that routine doesn't move memory, simply calling it may. Yikes. This reminds me of Microsoft Windows 3.0's approach to code segments. They *can* move around between calls, but Windows has a daemon which actually walks the return stack and patches addresses so that they jive. Zowie. -- joe