Escaping the Tyranny of the GC: std.rcstring, first blood

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 27 12:53:16 PDT 2014


27-Sep-2014 23:15, Andrei Alexandrescu пишет:
> On 9/27/14, 2:43 AM, Dmitry Olshansky wrote:
>> Refcounting is process of add(x), and sub(x), and calling destructor
>> should the subtract call report zero. Everything else is in the hands of
>> the creator.
>
> I literally have no idea what you are discussing here. -- Andrei

That proposed scheme is completely abstract as to what exactly adding X 
to a ref-count does. Or what exactly subtracting X from ref-count does.
The only invariant is that there is something that will tell us after 
yet another decrement that ref-count is zero and we should free resources.

As I said elsewhere - automagically embedding ref-count is too limiting, 
there is whole lot of ways to implement count including intrusive and 
non-intrusive.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list