Mac Apps That Use Garbage Collection Must Move to ARC

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Feb 24 01:55:54 PST 2015


On 2/23/2015 11:57 PM, Jacob Carlborg wrote:
> On 2015-02-22 21:48, Walter Bright wrote:
>
>> And I suspect that ARC is why they don't have exceptions.
>
> Objective-C still has both ARC and exceptions. Although the documentation [1]
> says that ARC is not exception safe by default, but it does have a flag to
> enable it "-fobjc-arc-exceptions".
>
> [1] http://clang.llvm.org/docs/AutomaticReferenceCounting.html#exceptions

 From your reference:

"Making code exceptions-safe by default would impose severe runtime and code 
size penalties on code that typically does not actually care about exceptions 
safety. Therefore, ARC-generated code leaks by default on exceptions, which is 
just fine if the process is going to be immediately terminated anyway. Programs 
which do care about recovering from exceptions should enable the option."

Note "severe runtime and code size penalties". Just what I said.


More information about the Digitalmars-d mailing list