Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!husc6!endor!siegel From: siegel@endor.harvard.edu (Rich Siegel) Newsgroups: comp.sys.mac.programmer Subject: Re: THINK C: longjmp through methods? Message-ID: <3940@husc6.harvard.edu> Date: 17 Aug 90 23:16:42 GMT References: <423@sun13.scri.fsu.edu> Sender: news@husc6.harvard.edu Reply-To: siegel@endor.UUCP (Rich Siegel) Organization: Symantec Language Products Group Lines: 33 In article <423@sun13.scri.fsu.edu> pepke@gw.scri.fsu.edu (Eric Pepke) writes: >Here's one for Rich and the rest of the THINK C gurus. > >Is it safe to do a setjmp/longjmp through a series of object messages the >same way one can do it through a series of function calls, or is there >Memory Manager stuff in the method chain that will be vulnerable? For all intents and purposes, longjmp'ing through the method chain is the same as longjmp'ing through an ordinary call chain. >Application: a top-down compiler that for some imponderable reason I >decided to implement as methods. I want to have a command-period >compilation abort without having to do an unwind everywhere. You'll probably want to longjmp through to several points; you won't have to unwind *everywhere*, but you'll almost certainly want to clean up any temporary allocations... The UFailure mechanism from MacApp is an elegant solution to this problem; with some hacking, it can be adapted for use in C... R. ~~~~~~~~~~~~~~~ Rich Siegel Staff Software Developer Symantec Corporation, Language Products Group Internet: siegel@endor.harvard.edu UUCP: ..harvard!endor!siegel "Who could sleep when there's a hunk with no clothes on wandering around at five in the morning, knocking over furniture?" ~~~~~~~~~~~~~~~