search for: simpleref

Displaying 8 results from an estimated 8 matches for "simpleref".

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_alloc(). 'Writing R Extensions" says R will reclaim memory allocated using R_alloc() at the end of...
2003 Feb 28
1
R (external ?) reference
Dear List, I found a documentation on the web that mentions things like 'R references' (http://www.stat.uiowa.edu/~luke/R/simpleref.html). However, I could not find the R_MakeReference and friends in R... Does anyone knows more about that ? Thanks, L.
2005 Dec 09
3
external pointers
...way to do so. I'm trying to find how they interact with garbage collection and object lifetime, and what I need to do so that the memory lives until the calling R process ends. Could anyone give me some pointers? I haven't found much documentation. An earlier message suggested looking at simpleref.nw, but I can't find that file. So the overall pattern, from R, would look like opaque <- setup(arg1, arg2, ....) # setup calls a C fn docompute(arg1, argb, opaque) # many times. docompute also calls C # and then when I return opaque and the memory it's wrapping get #cleaned up. If...
2001 Jul 10
1
Object finalization
I see some code in R to attach finalizers to external pointer references (Register[C]Finalizer). Anyone have an example of how to code the finalizer? R_RegisterCFinalizer accepts a C function, but I can't see how to get it to operate on the pointer, since the pointer is not passed to the function when its called. RegisterFinalizer takes an R closure, but how is it called from R (tried
2006 Jul 24
2
persistent C++ objects
Hi, I am trying to create an R interface for Dynare++ [1], a k-order solver for rational expectation models. I would like some advice on how to glue the C++ code to R. In C++, it works the following way: - a DynareModelEq object is initialized with the formulas, parses them and performs k-order symbolic expansions - the user calls a member of this object multiple times with parameter
2007 Mar 14
1
allocVector reference
Hi, I'm trying to write a function to return an R vector which points directly to a contiguous subset of another vector, without taking a copy. Since SEXPREC is a header followed by the data, rather than the header plus a pointer to the data, I'm not sure what I'm trying to do is possible. Is there a way of doing this? Similar in spirit to how the R assignment "x=y" does
2001 Oct 02
2
Avoiding deep copies
Is it correct that there is no way of avoiding deep copying of data structures? Or asked from a different perspective, is it true that there are no pointers? :) (not that I am a fan of pointer, they just let me decide when to do deep copy on my own when the memory manager doesnt do it for me :) ) I was considering writing code in R that would need the internal representation of complex graph
2001 Mar 19
3
generic database access methods
I've been putting together a package that defined generic methods for database access. The packages is called "Rdbi." It borrows as much as possible from existing database packages / proposals. I'd like to start a discussion about the proposed interface. Here's what I've come up with so far: # # Rdbi: connectionMethods.R # dbConnect <- function(dbObj, ...)