05-11-2010 11:47 AM
Hello,
I am trying to allocate dinamically 3 pointers in memory. First one will storage a binary file, bigger than 1GB, as char, second one would be a copy from first, but as Uint16 (unsigned short). Third one would be a 3x3 matrix double type. I am using malloc to allocate those pointers.
cBuffer = (char*) malloc(size*sizeof(char))
iBuffer = (unsigned short*) malloc(size*sizeof(unsigned short))
dMatrix = (double***)malloc(size*sizeof(int))
for(i=0; i<size; i++)
dMatrix[i]=(double**)malloc(size*sizeof(unsigend short))
for(j=0; i<size;i++)
dMatrix[j]=(double*)malloc(size2*sizeof(double))
where "size" always would be bigger than 1GB and size2 is a little bit bigger than size, cBuffer is a pointer to char, iBuffer is a pointer to unsigned int and dMatrix is a pointer 3*3 to a double.
The problem is when I try to allocate memory for iBuffer, CVI can not allocate it, malloc function returns me a NULL pointer.
Someone knows how can I allocate huge buffers in memory using malloc?
I am working in a PC with Windows XP SO and 4 GB in RAM, so I have enough memory to do it. 500GB in HDD
Thanks in advance!
Hiram Hernandez
05-11-2010 12:58 PM
05-11-2010 01:53 PM
05-11-2010 03:19 PM
05-12-2010 03:48 PM
Thanks to all,
So I need change to a 64 bits system in order to process more than 1.5GB in memory.