[D1] gc safety

%u e at ee.com
Tue Oct 12 15:10:53 PDT 2010


Please tell me if anything is unclear/stupid :)

== Quote from %u (e at ee.com)'s article
> How gc unfriendly is an union of objects and sizet_t?
> union{
>   size_t arr[10];
>   Class obj[10];
> }
> And, if multiple arrays contain exclusively the same objects, is it then
> safe/useful to mark all but the smallest array with gc.hasNoPointers?
> Any object removal/addition happens simultaneous across all the arrays.
> void remove(size_t i){
>   size_t i2 = arr[i].i2;
>   arr2[i2] = null;
>   arr[i] = null;
> }



More information about the Digitalmars-d-learn mailing list