RCArray is unsafe

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 3 09:45:12 PST 2015


On 03/03/2015 13:05, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" 
wrote:
> The bigger problem is that it's relying on a convention. The RC wrapper
> needs to be constructed in a particular way that's easy to get wrong and
> that the compiler has no way to check for us.

Maybe the compiler could enforce that opRelease is truly @safe - i.e. 
doesn't call any @trusted code. Although there would still need to be an 
escape hatch for doing unsafe ref-counting without the overhead of a 
free list.


More information about the Digitalmars-d mailing list