D/Objective-C, extern (Objective-C)

Walter Bright newshound2 at digitalmars.com
Mon Jun 24 13:31:34 PDT 2013


On 6/24/2013 1:18 PM, Michel Fortin wrote:
> That's not a so big problem: just disallow taking pointers to member variables
> inside of reference-counted memory blocks. At least in SafeD. This is a quite
> rare thing to do in Objective-C anyway, I'd be surprised if it bothered anyone.
>
> And I don't think it is very common in D either. Either way, if D was to
> implement ARC for its own memory allocator instead of the current GC (which
> would be great) there's noting to prevent implementing it so that reference
> counts could be incremented from the middle address of a memory block, it'd be
> quite easy in fact, and quite necessary too because of the way arrays work.
>
> Usually, the most annoying part of ARC is retain cycles, especially implicit
> ones created by blocks (Objective-C's delegate literals).

If the ref-counted blocks are allocated in the GC space, a GC run will get rid 
of them!



More information about the Digitalmars-d-announce mailing list