search for: ptr_attribute

Displaying 1 result from an estimated 1 matches for "ptr_attribute".

Did you mean: pg_attribute
2011 Dec 28
1
external pointers
...9;ve noted that "external pointers should only be used as part of an object with normal semantics, for example an attribute or an element of a list." So I've written up a workable C function as such: SEXP my_c_function(SEXP param) { SEXP temp = getAttrib(param, install("ptr_attribute")); void * ptr = R_ExternalPtrAddr(temp); ... // do useful things with ptr } I can pass my_c_function() an object with "normal" semantics (such as an integer vector), where the external pointer object is a parameter named "ptr_attribute". The function extracts...