www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - GC noscan and primitve type arrays

reply Benjamin Thaut <code benjamin-thaut.de> writes:
I'm curious,
does the GC allocate primitive type arrays like uint[] as noscan memory 
block, or are those data blocks considered for scanning? And if so why?
I have a small program that works with lots of uint[] arrays and goes 
out of memory. The data set it works on is not even close to the maximum 
memory amount available. So I think these uint[] arrays keep each other 
alive.

Kind Regards
Benjamin Thaut
Dec 28 2013
parent "Daniel Murphy" <yebblies nospamgmail.com> writes:
"Benjamin Thaut" <code benjamin-thaut.de> wrote in message 
news:l9mdb4$1lmf$1 digitalmars.com...
 I'm curious,
 does the GC allocate primitive type arrays like uint[] as noscan memory 
 block, or are those data blocks considered for scanning? And if so why?
 I have a small program that works with lots of uint[] arrays and goes out 
 of memory. The data set it works on is not even close to the maximum 
 memory amount available. So I think these uint[] arrays keep each other 
 alive.

 Kind Regards
 Benjamin Thaut
import core.memory; import std.stdio; void main() { auto x = new uint[](200); writeln((GC.getAttr(x.ptr) & GC.BlkAttr.NO_SCAN) != 0); }
Dec 28 2013