Status of @nogc with the runtime

Adam D. Ruppe destructionator at gmail.com
Sun Oct 6 13:59:30 UTC 2019


On Sunday, 6 October 2019 at 12:50:04 UTC, IGotD- wrote:
> Dynamic arrays and associative arrays are very useful even in a 
> betterC environment. Wouldn't it be better to rewrite the 
> dynamic arrays to use an internal storage struct using atomic 
> reference counting similar to C++ strings

I think that'd be a mistake. D's slices are versatile and 
lightweight right now, they can be used with gc or malloc or 
anything else and this change would jeopardize that.

It is easy to make a library array type that works like you 
described, and it can even yield built-in slices when you want 
that.

If anything I'd just let you disable built in dynamic array 
append/concat so it calls out when you need to put in a wrapper...


More information about the Digitalmars-d mailing list