RCArray is unsafe

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


On 3/3/15 10:22 AM, Zach the Mystic wrote:
> On Tuesday, 3 March 2015 at 17:40:59 UTC, Marc Sch├╝tz wrote:
>> All instances need to carry a pointer to refcount anyway, so the
>> freelist could just be stored next to the refcount. The idea of
>> creating that list, however, is more worrying, because it again
>> involves allocations. It can get arbitrarily long.
>
> If the last RcType is a global, will the list ever get freed at all?

No. Making a global variable of a reference counted type would be poor 
design.


Andrei


More information about the Digitalmars-d mailing list