Displaying 3 results from an estimated 3 matches for "r_allocateptr".
2005 Jul 19
2
R_AllocatePtr
Had been looking into Luke Tierney's R_AllocatePtr() and
was left with a question about exactly when does R reclaim
heap memory. Implication of 'simpleref.nw' is that one can
allocate C data on the R heap, and as long as pointer object
is alive, the data and pointer will remain valid. But it
calls allocString() which is implemented using R_...
2005 Jul 19
1
S4 Dispatching
Is it possible for S4 to (continue) dispatch to a class
created during dispatching? The code below doesn't work;
is this not possible or have I ommitted something?
Concept was to create a SEXP with R_AllocatePtr, give it
a class attribute, and continue dispatch. Example code
below omits multiple parameters that can be different types.
Essentially, any parameter would be converted to an
internal type "class" and the final dispatch would be
passing EXTPTRSXP objects.
library(methods)
setGeneric(...
2005 Jul 26
1
Error registering finalizer
...ss("ProbesetGE",
representation("PDNNObject"))
----
static void ProbesetGE_finalizer(SEXP vntData)
{
Rprintf("In ProbesetGE_finalizer()\n");
/* Deallocate memory of structure fields */
}
static SEXP AllocateProbesetGEPtr(unsigned count)
{
return R_AllocatePtr(count,
sizeof(ProbesetGE_t),
ProbesetGETypeTag));
}
SEXP R_PDNN_newProbesetGE(unsigned count)
{
SEXP vntObj;
SEXP vntClassDef;
SEXP vntData;
SEXP vntAttr;
SEXP vntHandle;
unsigned n = 0;
PROTECT(vntClassDef = MAKE_CLASS...