GC interpreting integer values as pointers

Steven Schveighoffer schveiguy at yahoo.com
Thu Oct 14 10:47:54 PDT 2010


On Thu, 14 Oct 2010 13:35:13 -0400, Ivo Kasiuk <i.kasiuk at gmx.de> 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 know about the NO_SCAN flag but what
> memory region should it be applied to in this case?

This is a common problem.  I am not intimately familiar with AAs, but it  
may have something to do with the fact that it's not a templated type.   
That means the runtime is responsible for allocating AA nodes.

I think at the moment there is no way to do this.  I also think there is  
likely a bug report to this effect, and that others may have implemented  
better AAs to fix the issue.  Try searching the bug database for AA and  
NO_SCAN.

-Steve


More information about the Digitalmars-d-learn mailing list