RCArray is unsafe

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 3 09:42:32 PST 2015


On 3/3/15 9:30 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" wrote:
> On Tuesday, 3 March 2015 at 15:01:02 UTC, Andrei Alexandrescu wrote:
>> On 3/3/15 5:05 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>"
>> wrote:
>>> The object is still accessible after its refcount went to zero, and can
>>> therefore potentially be resurrected. Probably not a problem, but needs
>>> to be taken into account, in particular in with respect to the freelist.
>>> That's tricky, because an object can be released and resurrected several
>>> times, and care must be taken that it will not end up in the freelist
>>> and get destroyed multiple times. And that hasn't even touched on
>>> thread-safety yet.
>>
>> Could you please give an example?
>
> No, I can't, because it isn't true. I was confused...

<silently wipes sweat off forehead>


More information about the Digitalmars-d mailing list