[Rcpp-devel] Have I noticed memory management bug in RcppArmadillo or is this the intended behaviour?

Dirk Eddelbuettel edd at debian.org
Thu Oct 27 14:08:05 CEST 2011


On 27 October 2011 at 20:17, Slava Razbash wrote:
| What my function had in common with the fastLm functions is that both used:
| return Rcpp::List::create( );
| and both used arma::mat objects.

Memory returned to R is freed when R decides to free it.

To make your "tests" comparable, all (incl Rcpp, RcppArmadillo, R API and R
function) have to create and return the same object --- test with identical()
or at least all.equal().  Easiest to do by returning a single NULL (via
R_NilValue) and nothing else.

You returned larger objects from RcppArmadillo / fastLm() so maybe those hang
around longer.

Dirk

-- 
"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx


More information about the Rcpp-devel mailing list