[R] memory allocation problem under linux
antonio.dinarzo@studio.unibo.it
antonio.dinarzo at studio.unibo.it
Sun Jun 12 18:46:23 CEST 2005
I've written:
> #define NMAX 256
> long **box;
> ...
> box = (long **)R_alloc(NMAX, sizeof(long *));
>gives a null pointer, so subsequent line:
> for (i=0; i<NMAX; i++) box[i] = (long *) R_alloc(NMAX, sizeof(long));
>gives a SIGSEGV signal.
Sorry, that's not exact: I have a segmentation fault just *inside* R_alloc!
Substituting R_alloc with malloc and Calloc gives the same error.
More information about the R-help
mailing list