Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NS_HANDLER mystery



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.