Open kylebaron opened 2 months ago
I think rather than making it work like this by default, instead let the user cache the pointers for when the model is getting run over and over.
setpointers()
getpointers()
mrgsolve.cpp
mrgsolve_init.cpp
loadso()
mread()
mread_cache()
// [[Rcpp::export]] bool VALIDPOINTERS(Rcpp::List x) { if(x.size()==0) return false; for(size_t i = 0; i < x.size(); ++i) { if(R_ExternalPtrAddr(x[i]) == NULL) { return false; } } return true; }
setpointers <- function(x) { x@shlib$pointers <- pointers(x, refresh = TRUE) x } getpointers <- function(x) { x@shlib$pointers }
I think rather than making it work like this by default, instead let the user cache the pointers for when the model is getting run over and over.
setpointers()
andgetpointers()
mrgsolve.cpp
mrgsolve_init.cpp
loadso()
mread()
mread_cache()