home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!spool.mu.edu!agate!NewsWatcher!user
- From: werner@soe.berkeley.edu (John Werner)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Pointers to function and UnloadSeg
- Followup-To: comp.sys.mac.programmer
- Date: 24 Nov 1992 03:48:28 GMT
- Organization: UC Berkeley School of Education
- Lines: 23
- Distribution: world
- Message-ID: <werner-231192194549@128.32.157.31>
- References: <1992Nov23.002629.3444@ccu1.aukuni.ac.nz>,<keith-231192142230@kip-15.taligent.com> <1992Nov24.011014.9522@alw.nih.gov>
- NNTP-Posting-Host: 128.32.157.31
-
- In article <1992Nov24.011014.9522@alw.nih.gov>, Chris Spiral Catfish Tate
- wrote:
- >
- > In a related vein, what about calling UnloadSeg() on code segments that are
- > in your function's calling chain, but not in the same segment? Are all
- > those code segments locked reliably?
-
- I think you're asking whether it's safe to call UnloadSeg on segments that
- are in the current call tree/stack, but that don't contain the function
- currently executing. If so, don't; this is a recipe for disaster. Imagine
- that a funciton calls UnloadSeg on its caller's segment, then does
- something that purges memory. When it returns, its caller won't be there,
- and there will be a spectacular (and probably hard to debug) crash.
-
- >Might this sort of thing interact oddly with setjmp() and longjmp() in
- >THINK C 5?
-
- It would interact oddly with just about _anything_, including setjmp and
- longjmp.
-
- --
- John Werner werner@soe.berkeley.edu
- UC Berkeley School of Education 510-642-9651
-