[Rd] Pb with defineVar() example in the "Writing R Extensions" manual
Herve Pages
hpages at fhcrc.org
Wed Jan 16 23:59:20 CET 2008
Peter Dalgaard wrote:
> Herve Pages wrote:
[...]
>> So everybody seems to assume that SET_ELEMENT(), SET_STRING_ELT(),
>> SET_NAMES(), etc... can't (and will never) trigger garbage collection.
>> But what about defineVar()? More generally, how do I know this for the
>> functions/macros listed in Rdefines.h and Rinternals.h?
>>
> Yes, that point was well taken. You can't know unless we write it
> somewhere. You can read the sources, but that is no guarantee that it
> won't change in future versions. We should be better at documenting that
> stuff, if for no other reason then to be able to distinguish between
> YOUR bugs and OUR bugs.
> If you grep through the sources, you'll find a number of instances of
> things like
>
> defineVar(name, mkPromise(...), ...)
>
> which would break along with your case, but that is of course only an
> indication, not proof that you can actually leave the value unprotected.
>
Agreed. Thanks for your reply!
H.
More information about the R-devel
mailing list