[GRASS-dev] Allocating memory for a huge array

Damiano Triglione damiano.triglione at polimi.it
Thu Mar 22 13:21:00 EDT 2007


Hi,
in a Grass module I am developing, I would like to allocate a huge array. I thought to use something like:

unsigned int * H_Array;
(...)
H_Array=(unsigned int *)G_calloc(2^32, sizeof(unsigned int));

because in this way (unsigned int) with 32 bits I can manage 4 billions cells, instead of 2 billions related to 32 bits as (traditional signed) int.
At compile-time, I receive a warning:
 warning: passing arg 1 of `G_calloc' as signed due to prototype

Thus, I realize that I am not succeeding in what I want!
Is there a different G_calloc function that provides a prototype suitable for my needs?
Thank you in advance,
Damiano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-dev/attachments/20070322/e5da258f/attachment.html


More information about the grass-dev mailing list