DIP74: Reference Counted Class Objects

via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 27 01:15:06 PST 2015


On Thursday, 26 February 2015 at 21:50:56 UTC, Andrei 
Alexandrescu wrote:
> http://wiki.dlang.org/DIP74 got to reviewable form. Please 
> destroy and discuss.

Destroy:

The scheme is too simplistic.

You need to add "policy" as a template parameter to 
retain/release so that you can support different ownership 
schemes with strong typing (compile time).

You also need a policy-link between the receiver and the object.

The DIP needs to prove that the protocol can be used to 
efficiently implement the following in various configurations:

- weak-references with zeroing

- auto release pools

- unique ownership

- optional locking and transfer between threads

- wrapping of foreign objects that have their own RC scheme


More information about the Digitalmars-d mailing list