Status of @nogc with the runtime

IGotD- nise at nise.com
Sun Oct 6 12:50:04 UTC 2019


On Saturday, 17 February 2018 at 18:03:44 UTC, Peter Campbell 
wrote:
>
> I've read about BetterC and I'm interested in the minimal 
> runtime feature, that seems like it'll be really cool. But 
> these methods requiring not using certain D features which rely 
> on the GC. My understanding from the vision documents and what 
> Andrei mentioned at his DConf presentations is that the runtime 
> itself will be modified to not rely on the GC, allowing for you 
> to continue using features such as associative arrays and array 
> concatenation, but without requiring the garbage collector. Is 
> my understanding correct? If so is work still being done to 
> make this happen and is there an easy way to follow the 
> progress?
>

Any more progress regard this? 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 (at least in some previous implementations). This way 
arrays are only dependent malloc/free. Using the reference 
counting, slicing would be supported just as before if I'm not 
mistaken.

I also don't think this should be special variant of druntime. 
Reference counted dynamic arrays could go into the full D 
language as well. This would probably even reduce the memory 
consumption compared to the current GC implementation.


More information about the Digitalmars-d mailing list