NS_HANDLER mystery
NS_HANDLER mystery
- Subject: NS_HANDLER mystery
- From: Will Mason <email@hidden>
- Date: Fri, 29 Jul 2005 17:53:50 -0700 (PDT)
In looking at the implementation of NS_DURING, NS_HANDLER,
NS_ENDHANDLER, NS_VALUERETURN and NS_VOIDRETURN I've hit something that
completely stumps me, and I was hoping someone could enlighten me.
NS_DURING just puts an information structure on the stack, adds it to
some kind of internal collection, and calls setjmp. That's clear.
NS_HANDLER removes the structure from the internal collection in only
three of the four possible cases: when there is no exception, when a
value is returned from within the handler and when void is returned
from within the handler. Whenever NS_ENDHANDLER is reached the
structure is never removed from the internal collection. My question
is, why not?
Why does _NSRemoveHandler() never get called upon reaching
NS_ENDHANDLER? To me the logic would dictate that the structure should
either always be removed from the internal collection, or never. Having
three cases where it's removed and one case where it isn't just doesn't
make any sense to me.
Can anyone enlighten me?
Thanks,
Will
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden