[Rcpp-devel] Possible unprotected memory problems

Dirk Eddelbuettel edd at debian.org
Fri Jul 22 18:52:48 CEST 2011


That sounds doable.  The main thing that is unusal here is the 'pass to C++
and let C++ hold on to it' aspect -- a little like bigmemory, maybe?

So I'd start simple: pass it down to C++, make a copy (I know....) to a
static variable so that C++ holds on to it between calls, and then work on it
with repeated calls.  One issue worth stressing is that R is single-threaded,
so do you expect the C++ side to do some magic in another while your are back
in R? That sounds like a synchronisation headache....

If the above works, you can create new headaches by doing it without the
extra local copy. :)

Cheers, Dirk

Gauss once played himself in a zero-sum game and won $50.
                      -- #11 at http://www.gaussfacts.com

More information about the Rcpp-devel mailing list