Idea #1 on integrating RC with GC

Namespace rswhite4 at googlemail.com
Wed Feb 5 10:51:04 PST 2014


On Wednesday, 5 February 2014 at 18:45:28 UTC, Ola Fosheim 
Grøstad wrote:
> On Wednesday, 5 February 2014 at 18:33:54 UTC, Andrei 
> Alexandrescu wrote:
>> Phobos needs to be able to return allocated memory without 
>> creating litter. With RCSlice!T the ownership is passed back 
>> to the user. The user can continue tracking it by using 
>> reference counting built into RCSlice, or make the object 
>> "immortal" by calling .toGC against it.
>
> Would it be possible to use RCSlice for all reference counting? 
> I.e. that a reference counter for a struct would be a RCSlice 
> of fixed length 1?
>
> If so then maybe it would be nice, but with a different name.

shared_ptr? ;) Welcome to C++.


More information about the Digitalmars-d mailing list