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 Rd
Herve Pages wrote:
> Peter Dalgaard wrote:
>>
>> That's not the problem you raised (argument evaluation order), but
>> there's a CONS inside defineVar, and as far as I can see, it doesn't
>> protect its arguments, so you could well be right.
>>
>
> This problem is related to my original proble
Peter Dalgaard wrote:
> Herve Pages wrote:
>> Hi Peter,
>>
>> Peter Dalgaard wrote:
>>
>>> Herve Pages wrote:
>>>
Hi,
I'm wondering if this code from the "Writing R Extensions" manual
is really safe:
SEXP mkans(double x)
{
SEXP ans;
Luke Tierney wrote:
> On Wed, 16 Jan 2008, Peter Dalgaard wrote:
>
>> Herve Pages wrote:
>> Hi Peter,
>>
>> Peter Dalgaard wrote:
>>
>>> Herve Pages wrote:
>>>
Hi,
I'm wondering if this code from the "Writing R Extensions" manual
is really safe:
SEXP mkans(double
On Wed, 16 Jan 2008, Peter Dalgaard wrote:
Herve Pages wrote:
Hi Peter,
Peter Dalgaard wrote:
Herve Pages wrote:
Hi,
I'm wondering if this code from the "Writing R Extensions" manual
is really safe:
SEXP mkans(double x)
{
SEXP ans;
PROTECT(ans = allocVector(REA
Herve Pages wrote:
> Hi Peter,
>
> Peter Dalgaard wrote:
>
>> Herve Pages wrote:
>>
>>> Hi,
>>>
>>> I'm wondering if this code from the "Writing R Extensions" manual
>>> is really safe:
>>>
>>> SEXP mkans(double x)
>>> {
>>> SEXP ans;
>>> PROTECT(ans = allocVecto
Hi Peter,
Peter Dalgaard wrote:
> Herve Pages wrote:
>> Hi,
>>
>> I'm wondering if this code from the "Writing R Extensions" manual
>> is really safe:
>>
>> SEXP mkans(double x)
>> {
>> SEXP ans;
>> PROTECT(ans = allocVector(REALSXP, 1));
>> REAL(ans)[0] = x;
>
Herve Pages wrote:
> Hi,
>
> I'm wondering if this code from the "Writing R Extensions" manual
> is really safe:
>
> SEXP mkans(double x)
> {
> SEXP ans;
> PROTECT(ans = allocVector(REALSXP, 1));
> REAL(ans)[0] = x;
> UNPROTECT(1);
> return ans
Hi,
I'm wondering if this code from the "Writing R Extensions" manual
is really safe:
SEXP mkans(double x)
{
SEXP ans;
PROTECT(ans = allocVector(REALSXP, 1));
REAL(ans)[0] = x;
UNPROTECT(1);
return ans;
}
double feval(double x, SEX