tatami-inc / archive-beachmat

An archived version of the beachmat repository, see https://github.com/LTLA/beachmat for the active version.
8 stars 0 forks source link

Switch to Rcpp for the C++ API #2

Closed LTLA closed 7 years ago

LTLA commented 7 years ago

Wondering whether I should switch to Rcpp, in light of the recent discussion about changes to memory allocation and PROTECT philosophies in R's C API. There are two options for doing so:

As the tone suggests, I favour the latter. But if an Rcpp expert is willing to help, we could do the former.

LTLA commented 7 years ago

Done, albeit in an ugly and highly non-idiomatic way. Basically just set up Rcpp::RObject data members for each class so that the pointers of the class are always pointing to PROTECTed data across the lifetime of the class. The API still returns pointers of values, we're not using the Rcpp row/column objects.