From tjardie at gmail.com  Thu Jun 20 14:44:18 2013
From: tjardie at gmail.com (Tee-Jay-Ardie)
Date: Thu, 20 Jun 2013 05:44:18 -0700 (PDT)
Subject: [Rd] Calling an array in a struct in C to R
In-Reply-To: <51C2EE26.3020507@mayo.edu>
References: <1371651280258-4669884.post@n4.nabble.com>
	<51C2EE26.3020507@mayo.edu>
Message-ID: <1371732258885-4669972.post@n4.nabble.com>

Terry Therneau-2 wrote
> Another solution is the one used for a long time in the rpart code.
> The R code called "rpart1", which does the work, keeps a static pointer to
> the object, 
> does NOT
> release it's memory, and returned the size of the object.
> 
> Then the R code allocates appropriate vectors and called "rpart2", which
> filled in the 
> result and
> released the dynamic memory.

Yes, I thought of that solution. I discarded it though, as it seemed to me
that it would increase processing time considerably. Does it still increase
processing time when you have the static pointer pointed to the object to
prevent its release? 



Terry Therneau-2 wrote
> This was written before .Call was available.  It works, but I agree with
> Bill Dunlap that 
> you should use
> .Call.
> 
> Terry T.

I guess I should start reading up on .Call. 

If there are other ideas, I will gladly hear them.

Tee-Jay-Ardie



--
View this message in context: http://r.789695.n4.nabble.com/Calling-an-array-in-a-struct-in-C-to-R-tp4669884p4669972.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] Calling an array in a struct in C to R
Tee-Jay-Ardie