Smart pointers instead of GC?

Benjamin Thaut code at benjamin-thaut.de
Mon Dec 31 06:28:35 PST 2012


Am 31.12.2012 13:14, schrieb Sven Over:
>
> A smart-pointer type for arrays can easily provide slices. It keeps a
> reference to the full array (which gets destructed when the last
> reference is dropped), but addresses a subrange.

I did exactly implement this in 
https://github.com/Ingrater/druntime/blob/master/src/core/refcounted.d
Basically I implemented a struct that mimics a regular D array as far as 
possible, but it is using reference counting under the hood.

Kind Regards
Benjamin Thaut


More information about the Digitalmars-d mailing list