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

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


27-Sep-2014 23:14, Andrei Alexandrescu пишет:
> On 9/27/14, 2:38 AM, Dmitry Olshansky wrote:
>>
>> Okay it serves no good for me to make these tiny comments while on the
>> go.
>>
>> As usual, structs are value types, so this feature can be mis-used, no
>> two thoughts abouts it. It may need a bit of improvement in
>> user-friendliness, compiler may help there by auto-detecting common
>> misuse.
>
> I still don't understand what "this feature" is after reading your long
> post twice.
>
> So structs are still value types and you replace postblit/destroy with
> calls to opInc/opDec? That's it? How does this enable anything more
> interesting than ctors/dtors?
>

Compiler is aware that opInc and opDec are indeed ref-countinng ops, 
meaning that opInc + opDec = no op. I claim that this is enough to get 
"ARC" going.


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list