[Rd] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Dear R-devel members, The question: Is it possible to initialize and later free a large data structure strictly within a shared C library, to be used by a function in the C library that I'll call from R--without ever having to pass data to and from R? This is analogous to C++ object initializatio

[Rd] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Dear R-help members, *(My apologies for cross-posting to both R-help and R-devel -- this question straddles both domains...)* The question: Is it possible to initialize and later free a large data structure strictly within a shared C library, to be used by a function in the C library that I'll c

Re: [Rd] Initializing a large data structure to be accessed strictly within a shared C library

2011-12-27 Thread James Muller
Thanks Duncan, you've unclogged my thinking. For anybody interested, see below a sketch of the solution. Cheers, James --START SKETCH OF SOLUTION-- #include #include static typedef struct { int nrow, ncol; double *data; } _myparticle_data_struct; static _myparticle_data_struct mypar