Mac Apps That Use Garbage Collection Must Move to ARC

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sun Feb 22 20:43:47 PST 2015


On Monday, 23 February 2015 at 01:41:17 UTC, Adam D. Ruppe wrote:
> On Monday, 23 February 2015 at 01:38:35 UTC, Manu wrote:
>> All my ref counting types fiddle with the ref in every 
>> assignment, or every function call and return.
>
> Hmm, the optimizer could potentially tell "inc X; dec X;" is 
> useless and remove it without knowing what it is for.

It is not that easy. First you need to increment/decrement in an 
atomic manner (unless we finally decide to fix holes in the type 
system) so the optimizer is mostly blind.

But even if it could (we are not far from being able to do it), 
in most scenarios it is still an issue as you get potential 
exception unwinding. The unwind path must find the right 
reference count in there.


More information about the Digitalmars-d mailing list