Re: GC interpreting integer values as pointers

2010-10-14 Thread Steven Schveighoffer
On Thu, 14 Oct 2010 13:35:13 -0400, Ivo Kasiuk wrote: There is one case though that I am still not sure about: associative arrays. It seems that keys as well as values in AAs are scanned for pointers even if both are integer types. How can I tell the GC that I do not want them to be scanned? I

Re: GC interpreting integer values as pointers

2010-10-14 Thread Ivo Kasiuk
> On Sat, 09 Oct 2010 15:51:37 -0400, Ivo Kasiuk wrote: > > > Hi! > > > > In my D programs I am having problems with objects not getting finalised > > although there is no reference anymore. It turned out that this is > > caused by integers which happen to have values corresponding to pointers >

Re: GC interpreting integer values as pointers

2010-10-14 Thread Steven Schveighoffer
On Thu, 14 Oct 2010 12:39:33 -0400, bearophile wrote: Steven Schveighoffer: There are two problems here. First, D has unions, so it is impossible for the GC to determine if a union contains an integer or a pointer. D has unions, and sometimes normal C-style unions are useful. But in

Re: GC interpreting integer values as pointers

2010-10-14 Thread bearophile
Steven Schveighoffer: > There are two problems here. First, D has unions, so it is impossible for > the GC to determine if a union contains an integer or a pointer. D has unions, and sometimes normal C-style unions are useful. But in many situations when you have a union you also keep a tag t

Re: GC interpreting integer values as pointers

2010-10-14 Thread Steven Schveighoffer
On Sat, 09 Oct 2010 15:51:37 -0400, Ivo Kasiuk wrote: Hi! In my D programs I am having problems with objects not getting finalised although there is no reference anymore. It turned out that this is caused by integers which happen to have values corresponding to pointers into the heap. So I wro

Re: GC interpreting integer values as pointers

2010-10-12 Thread %u
== Quote from Ivo Kasiuk (i.kas...@gmx.de)'s article > > I added the struct again and also ran without the enclosing X class. > > > > With X : > > no reference > > == reference, ad3fd0, ad3fc0, ad3fa0, ad3f80 > > new uint > > AA > > struct > > uint > > reference > > > > Without X : > > no r

Re: GC interpreting integer values as pointers

2010-10-11 Thread Ivo Kasiuk
> > > ~snip > > > > > > > > This writes: > > > > new uint > > > > no reference > > > > == reference, f7490e20, f7490e10, f7490df0, > > f74 > > > > 90dd0 > > > > AA > > > > struct > > > > uint > > > > reference > > ... > > > > Thanks, > > > > Ivo > >

Re: GC interpreting integer values as pointers

2010-10-11 Thread %u
== Quote from Ivo Kasiuk (i.kas...@gmx.de)'s article > > ~snip > > > > > > This writes: > > > new uint > > > no reference > > > == reference, f7490e20, f7490e10, f7490df0, > f74 > > > 90dd0 > > > AA > > > struct > > > uint > > > reference > ... > >

Re: GC interpreting integer values as pointers

2010-10-11 Thread Ivo Kasiuk
> ~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,

Re: GC interpreting integer values as pointers

2010-10-11 Thread %u
== Quote from Ivo Kasiuk (i.kas...@gmx.de)'s article > Hi! ~snip > > This writes: > new uint > no reference > == reference, f7490e20, f7490e10, f7490df0, f74 > 90dd0 > AA > struct > uint > reference > So in most but not all situations the integer val

GC interpreting integer values as pointers

2010-10-09 Thread Ivo Kasiuk
Hi! In my D programs I am having problems with objects not getting finalised although there is no reference anymore. It turned out that this is caused by integers which happen to have values corresponding to pointers into the heap. So I wrote a test program to check the GC behaviour concerning int