Displaying 2 results from an estimated 2 matches for "recursiverelease".
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
...t(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(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...
2010 Jan 02
1
R_PreserveObject, R_ReleaseObject : reference counting needed ?
...r, 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_PreciousList = RecursiveRelease(object, R_PreciousList);
}
I'...