Re: Exception handling
Re: Exception handling
- Subject: Re: Exception handling
- From: Martin-Gilles Lavoie <email@hidden>
- Date: Fri, 31 Oct 2003 09:11:36 -0500
On 03-10-30, at 21:54, Scott Thompson wrote:
On Oct 30, 2003, at 1:51 PM, Michael B. Johnson wrote:
Can anyone comment on why this isn't on by default? In other words,
what's the cost (execution speed or app size, or layout in address
space) of enabling this? I'd like to put it on by default for my
stuff, but I'm not sure if there are carrying costs like C++'s
exceptions...
The objective-C language-based exception mechanism is exactly the same
as the mechanism used for the DURING/HANLDER macros. It is a
setjmp/longjmp based scheme. As such it would have the same overhead
as the macro based exceptions. By in large this is a minimal runtime
cost (to set up the setjmp/longjmp frames stack) and a small runtime
memory overhead during execution to hold those frames.
I actually tried to set the new exception mechanism switch, but didn't
succeed last night.
Since I had to quickly test out something that I knew could raise
exceptions, I opted to use the old
NS_DURING
NS_HANDLER
NS_ENDHANDLER
macros.
The compiler actually complained of an illegal use of exception and
that I turn on the new -fobjc-exceptions compiler flag for exceptions!
Buh!
I didn't quite get where this OTHER_CFLAGS flag is.
In the target inspector, there's no trace of that flag in either option
groups. Must I manually add it?
______________________________________________________________________
Martin-Gilles Lavoie
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.