• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NS_HANDLER mystery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NS_HANDLER mystery
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Re: change in model not reflected in interface
  • Next by Date: Re: NSString to char[]
  • Previous by thread: moving to bindings
  • Next by thread: Re: NS_HANDLER mystery
  • Index(es):
    • Date
    • Thread