>> Any code that throws exceptions will probably leak a few objects, since 
>> according to the ARC design doc the ABI requires not draining autorelease 
>> pools while unwinding the stack.
> 
> Are you sure (or does ARC work differently)?
> 
> <http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAutoreleasePools.html>:

That'll need to be updated.  If you look at the @autoreleasepool section of the 
ARC documentation, it specifically states that crossing out of one via an 
exception will not drain the pool.  There doesn't appear to be any way, even 
through compiler flags, to change this.

Also, if you look further, at the Exceptions section, it states that by default 
ARC is not exception-safe even aside from autorelease pools.  You can enable 
it, though - and it is enabled by default for Objective-C++ - using 
-fobjc-arc-exceptions.

You'll note that the "Rationale" comments on those two sections specifically 
lay out the expected usage of exceptions:  for programmer error.  That they're 
tolerated [somewhat] in Objective-C++ is simply a nod to history for the sake 
of compatibility.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to