[R] memory allocation problem under linux

From: <antonio.dinarzo_at_studio.unibo.it>
Date: Mon 13 Jun 2005 - 02:46:23 EST


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.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 13 02:53:39 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:33 EST