Displaying 3 results from an estimated 3 matches for "r_preciouslist".
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
...lot of objects are protected and/or external code is
protecting/releasing objects through a FIFO proxy.
> Reading the source (below, from memory.c) I think not, but some
> confirmation would help.
I understand the code in memory.c like an object preserved twice needs
to be freed twice: R_PreciousList is just a (linked) list, and
"R_PreserveObject(object)" adds the object to the beginning of the list
while "R_ReleaseObject(object)" removes the first "object" found from
the list.
> void R_PreserveObject(SEXP object)
> {
> R_PreciousList = CONS(ob...
2010 Jan 02
1
R_PreserveObject, R_ReleaseObject : reference counting needed ?
...s wondering if there was documentation about it.
In particular, if we preserve the same SEXP twice (or more), should we
implement some sort of reference counting ?
Reading the source (below, from memory.c) I think not, but some
confirmation would help.
void R_PreserveObject(SEXP object)
{
R_PreciousList = CONS(object, R_PreciousList);
}
static SEXP RecursiveRelease(SEXP object, SEXP list)
{
if (!isNull(list)) {
if (object == CAR(list))
return CDR(list);
else
CDR(list) = RecursiveRelease(object, CDR(list));
}
return list;
}
void R_ReleaseObject(SEXP object)
{
R_Pre...
2008 Feb 22
1
Calling R_PreserveObject from embedded R
Hello. This is my first post to the list, so first I'd like to thank
everybody for making and mantaining such a great product as R.
I'm writting a native binding to R from Dolphin Smalltalk. I've followed up
the examples of the documentation showing how to run R embedded, and I got
it partially working. However, I have a problem with the reference handling
of the R objects.