Re: Recuperating after NS_HANDLER
Re: Recuperating after NS_HANDLER
- Subject: Re: Recuperating after NS_HANDLER
- From: Shaun Wexler <email@hidden>
- Date: Sun, 16 May 2004 17:23:19 -0700
On May 16, 2004, at 4:04 PM, Ondra Cada wrote:
>
On 16.5.2004, at 22:52, Shaun Wexler wrote:
>
>
> each time you enter an exception block, it has to retrieve the
>
> current pthread to get the top handler from the thread-specific data,
>
> then walk the list of handlers...
>
>
Does it? Why, on earth?!?
>
>
I admit I've never ever gdb'ed the thing so I don't know what happens
>
there, but I *did* implement my own NS_DURING/HANDLER macros many
>
times in different environments. Therefore, I *do* know that *nothing*
>
is needed but (a) allocate the stack frame buffer, (b) mark it with a
>
setjmp. All the other stuff (if any, and with ObjC without automatic
>
objects there is next to none!) can be solved only if the exception
>
was raised--if ever.
Forgive me; I was referring to ObjC @try/@catch/@finally rather than
NS_HANDLER macros. Each form has its own evils. Regardless, there is
significant overhead which must be considered when using exception
handlers in moderate- to high-performance functions or methods, and
stack bloat (or overrun) can quickly occur with non-shallow recursion.
In any case, it's expensive to unnecessarily enter/exit exception
blocks within tight loops, which was the main point. ;)
--
Shaun Wexler
MacFOH
http://www.macfoh.com
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.