[Rd] memory management in C code
ruipbarradas at sapo.pt
Fri Dec 7 19:45:57 CET 2012
This is explained in Writing R Extensions, Section 6.1 file R-exts.pdf
in your distribution of R, folder doc.
There are two types of functions to allocate memory in C functions
called from R code.
1. R_alloc() - the memory is automatically reclaimed at the end of the
2. Calloc/Realloc - you must call Free() [ uppercase, not free() ] at
the end of the function call.
Hope this helps,
Em 07-12-2012 12:40, Vineeth Mohan escreveu:
> Hi ,
> I am a newbie to R and i am trying to create a R package which is pretty
> main memory intensive.
> I would like to know what happens to the variables allocated in the C code
> while writing R extensions based on C.
> Are they preserved until someone de-allocate them or are they taken out by
> R's garbage collection ?
> [[alternative HTML version deleted]]
> R-devel at r-project.org mailing list
More information about the R-devel