In message: <[EMAIL PROTECTED]>
            Joerg Sonnenberger <[EMAIL PROTECTED]> writes:
: On Thu, Jul 13, 2006 at 11:16:18AM +0530, Kamal R. Prasad wrote:
: > Im sorry I didn't understand you. setjmp() stores a few register contents
: > [notably ip] in a jmpbuf -which are restored after a longjmp(). How is the
: > try/catch mechanism more efficient than a setjmp()/longjmp() in terms of
: > space/time complexity?
: 
: Because you have to run setjmp for *every* try{}, independent of whether
: it is ever actually needed.

It is worse than even that.

You have to run setjmp for every frame, because there could be an
exception thrown from a lower frame to an upper frame and you have to
cleanup your frame when that happens.  Variables go out of scope, and
must be destructed, etc.

Warner
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to