DIP74: Reference Counted Class Objects

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 26 17:44:36 PST 2015


On 2/26/15 5:41 PM, weaselcat wrote:
> On Friday, 27 February 2015 at 00:10:00 UTC, deadalnix wrote:
>> No problem, I'm gonna duplicate all my code and as will every single
>> library writer out there.
>
> Correct me if I'm wrong, but to me this presents itself as an
> alternative only for things that require deterministic ownership
> semantics(e.g, OpenGL resource wrapper)
>
> I don't think this is a full ARC system intended to replace the GC that
> would require library authors to write two versions of their libraries.
>
> But I could be entirely wrong.

DIP74 allows defining objects outside the Object hierarchy that are 
reference counted. This allows apps in which GC and RC approaches coexist.

An interesting option to explore in the future would be rigging druntime 
to add opAddRef and opRelease to Object.


Andrei



More information about the Digitalmars-d mailing list