draft proposal for ref counting in D

inout inout at gmail.com
Fri Oct 11 19:16:29 PDT 2013


On Thursday, 10 October 2013 at 08:55:00 UTC, Robert Schadek
wrote:
> On 10/10/2013 03:45 AM, Walter Bright wrote:
>> Rainer Schuetze wrote:
>>
>> You have to put the lock around the pair of AddRef and 
>> Release, but if
>> the compiler already splits this into two function calls, this 
>> cannot
>> be done in the implementation.
> I would imagine the counter to be manipulated with 
> atomic_add_and_fetch
> operations, so no locks are required.

On shared objects, yes. Local objects need no atomics at all.


More information about the Digitalmars-d mailing list