discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does GNUstep support exception as well as apple implementation?


From: David Chisnall
Subject: Re: does GNUstep support exception as well as apple implementation?
Date: Fri, 4 Jun 2010 14:30:47 +0100

On 4 Jun 2010, at 12:18, Shuduo Sang wrote:

> Does it mean the exception implementation of GNUstep is not complete as well 
> as Apple runtime?


There are two implementations of exception handling for use with GNUstep.  One 
is the old NeXT-style implementation, using setjmp()/longjmp(), which is slow, 
unsafe, and needs to die a quick and peaceful death.  You may only use this 
with the NS_DURING family of macros.

The other is DWARF zero-cost exception handling, which uses the same mechanism 
as the newer GNU C++ ABI and as Apple's modern runtime.  This uses asynchronous 
unwinding tables and allows cleanup in intervening stack frames irrespective of 
their language.  This ought to be the default, but I'm not sure if it is.

The catch is that you can not mix the two mechanisms, or you get some problems. 
 If you are using the @throw stuff, then you are using the DWARF ABI, but if 
your GNUstep is using the setjmp() mechanism then you may experience problems.

Note that there are several errors and serious omissions in the explanation of 
the code in the page that you linked to - I haven't read the code example in 
detail, but if it's written by someone with the same little understanding of 
the EH mechanism as displayed by the author of the page, then I wouldn't be 
surprised if it's buggy.

David

-- Sent from my brain




reply via email to

[Prev in Thread] Current Thread [Next in Thread]