From hpages at fhcrc.org  Wed Jan 16 23:59:20 2008
From: hpages at fhcrc.org (Herve Pages)
Date: Wed, 16 Jan 2008 14:59:20 -0800
Subject: [Rd] Pb with defineVar() example in the "Writing R Extensions"
 manual
In-Reply-To: <478E77BB.3040400@biostat.ku.dk>
References: <478D549E.40406@fhcrc.org> <478DD547.5080608@biostat.ku.dk>
	<478E4577.8040402@fhcrc.org> <478E48CD.3000602@biostat.ku.dk>
	<478E54D6.5040301@fhcrc.org> <478E77BB.3040400@biostat.ku.dk>
Message-ID: <478E8C48.1060807@fhcrc.org>

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.



[Rd] Pb with defineVar() example in the "Writing R Extensions" manual
Herve Pages