Skip to content
Prev 15734 / 63461 Next

How allocate STRSXP outside of gc

Thanks Duncan!

R_PreserveObject will do. One thought, wouldn't it make sense to modify
R_PreserveObject to return its argument?
This would allow things like

static SEXP fooSexp = R_PreserveObject(mkChar("foo"));

and would also make R_PreserveObject more similar to Rf_protect().

There should be no problem w/ backward compatability, at least not that
I could see.

Thanks,
Vadim