search for: extptr_ptr

Displaying 4 results from an estimated 4 matches for "extptr_ptr".

2020 Jul 22
1
CAR0 vs. EXTPTR_PTR
...0. % R-4.0.0 --quiet > library(Rcpp, lib="lib-4.0.2") Error: package or namespace load failed for ?Rcpp? in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/tmp/bill/lib-4.0.2/Rcpp/libs/Rcpp.so': /tmp/bill/lib-4.0.2/Rcpp/libs/Rcpp.so: undefined symbol: EXTPTR_PTR In addition: Warning message: package ?Rcpp? was built under R version 4.0.2 It looks like R's include/Rinternals.h was rejiggered so the function EXTPTR_PTR is called when CAR0 used to be. (I think they do the same thing.) Bill Dunlap TIBCO Software wdunlap tibco.com
2020 Jun 29
1
Possible ABI change in R 4.0.1
Hi all, it seems that from R 4.0.1 EXTPTR_PTR can be either a macro or a function, depending on whether USE_RINTERNALS is requested. Jeroen helped me find that this was in 78592: https://github.com/wch/r-source/commit/c634fec5214e73747b44d7c0e6f047fefe44667d This is a problem, because binary packages that are built on R 4.0.1 or R 4.0.2 will...
2015 Nov 25
0
Custom C finalizers for .Call
...o take your example, the way would typically write that code safely is something like typedef struct { xmlNodePtr *node; EVP_PKEY_CTX *ctx; } my_context_t; // define how to dispose of all things you care about correctly static void context_fin(SEXP what) { my_context_t *c = (my_context_t*) EXTPTR_PTR(what); if (!c) return; if (c->ctx) EVP_PKEY_CTX_free(c->ctx); if (c->node) xmlFreeNode(c->node); } [...] // allocate the context and tell R to manage its protection and finalization // (you could write a macro to make this one-liner) my_context_t* c = (my_context_t*) R_Call...
2015 Nov 23
4
Custom C finalizers for .Call
WRE explains that R_alloc() can be used to allocate memory which automatically gets released by R at the end of a .C, .Call or .External, even in the case of an error or interruption. This is a really great feature to prevent memory leaks. I was wondering if there is a way to extend this mechanism to allow for automatically running UNPROTECT and custom finalizers at the end of a .Call as well.