On Mon, 24 Aug 2009, Saptarshi Guha wrote:
> Thank you. So the reason I wouldnt need to protect y had I returned to
> R, is because had i had done something like
>
> h<-.Call("boo",a)
> where "boo" contains y=foo()
>
> the assignment "<-" to h would have a PROTECT somewhere, i.e R's
> assignment
Oh! Yes, this is the GC at work, "root objects" and everything
referenced from them.
I think I'm understanding the need for PROTECT better.
Thank you
Saptarshi
On Mon, Aug 24, 2009 at 9:39 AM, Duncan Murdoch wrote:
> On 8/24/2009 9:33 AM, Saptarshi Guha wrote:
>>
>> Thank you. So the reason I wo
On 8/24/2009 9:33 AM, Saptarshi Guha wrote:
Thank you. So the reason I wouldnt need to protect y had I returned to
R, is because
had i had done something like
h<-.Call("boo",a)
where "boo" contains y=foo()
the assignment "<-" to h would have a PROTECT somewhere, i.e R's
assignment is doing the
Thank you. So the reason I wouldnt need to protect y had I returned to
R, is because
had i had done something like
h<-.Call("boo",a)
where "boo" contains y=foo()
the assignment "<-" to h would have a PROTECT somewhere, i.e R's
assignment is doing the protection for me.
Had I not returned to R, I
On 8/24/2009 9:10 AM, Sapsi wrote:
Hello
Thank you for the response. So if my call is
y=foo()
z=malloc ( by memory allocations , do you mean via R_alloc and
allocVector and malloc or just the former two)
Any allocation which is managed by R's memory manager, so that includes
the former two,
Hello
Thank you for the response. So if my call is
y=foo()
z=malloc ( by memory allocations , do you mean via R_alloc and
allocVector and malloc or just the former two)
Other statements
Then I need to protect y. And in my case I don't return to R since I
have embedded it.
Why is this the
On 8/23/2009 11:52 PM, Saptarshi Guha wrote:
Hello,
Suppose I have the function
SEXP foo(){
SEXP s;
PROTECT(s=allocVector(...))
UNPROTECT(1);
return(s)
}
y=foo() // foo is a recusrive call
Q: Am i correct in understanding that one does not need to write
PROTECT(y=foo()) ?(and a correspond
Hello,
Suppose I have the function
SEXP foo(){
SEXP s;
PROTECT(s=allocVector(...))
UNPROTECT(1);
return(s)
}
y=foo() // foo is a recusrive call
Q: Am i correct in understanding that one does not need to write
PROTECT(y=foo()) ?(and a corresponding unprotect later on)
since it is the object