GC interpreting integer values as pointers
Ivo Kasiuk
i.kasiuk at gmx.de
Mon Oct 11 11:06:29 PDT 2010
> ~snip
> > ----------------------------------------
> > This writes:
> > new uint
> > no reference
> > ========== reference, f7490e20, f7490e10, f7490df0, f74
> > 90dd0
> > AA
> > struct
> > uint
> > reference
...
> > Thanks,
> > Ivo
>
> In D1:
...
> Writes:
> no reference
> ========== reference, ad3fd0, ad3fb0, ad3f90
> new uint << ;)
> AA
> uint
> reference
Thanks for trying it out in D1.
So, summing up this means that:
- In most cases, memory is by default scanned for pointers regardless of
the actual data types.
- In D2, newly allocated memory for a non-pointer data type (like "new
uint" or "new uint[10]") is not scanned by default.
- In D1, you have to use hasNoPointers if you want some memory not to be
scanned.
Is this observation correct?
And what about structs/classes that have integer fields as well as
pointer/reference fields?
And what about associative arrays - apparently these are scanned even if
the type is uint?
Ivo
More information about the Digitalmars-d-learn
mailing list