[D1] gc safety

%u e at ee.com
Wed Oct 13 04:10:36 PDT 2010


== Quote from Simen kjaeraas (simen.kjaras at gmail.com)'s article
> %u <e at ee.com> wrote:
> > == Quote from Simen kjaeraas (simen.kjaras at gmail.com)'s article
> >> %u <e at ee.com> wrote:
> >> > How gc unfriendly is an union of objects and sizet_t?
> >> >
> >> > union{
> >> >   size_t arr[10];
> >> >   Class obj[10];
> >> > }
> >> All elements of this union will be considered pointers by the GC.
> > The object will always occupy a continuous obj[0..x], is there some way
> > to explain
> > this to the GC?
> Perhaps. Is there a way to explain it to me? Do you mean the first x
> elements will be objects, and the rest will be size_ts that are not
> pointers?
Exactly that.


More information about the Digitalmars-d-learn mailing list