Re: [Rd] malloc/calloc/strdup and R's aequivalents

From: Dirk Eddelbuettel <>
Date: Sun, 18 Mar 2012 08:19:06 -0500

On 18 March 2012 at 06:16, oliver wrote:
| > R> library(inline)
| > R>
| > R> f <- cfunction(signature(), verbose=TRUE, body='
| > + double *p = Calloc(5, double);
| [...]
| That line cleared the issue.
| Thank you for providing an example.
| When reading in the documentation I was not sure,
| how to interpret "type" in setion 6.1.2.
| It was meant as the name of the type, and that's, why my
| sizeof() stuff created the problem.
| I tried around and then saw, that the name of the type
| is accepted, not only with typical base-types of C, but
| it also eats the names of my structs/typedefed structs.

Understandable, the manual is not toi clear there. The easiest answer, in such cases, is IMHO provided by other source packages.

Too bad the Google Code Search is now defunct. But besides a recursive grep in R's src/ directory, a simple Google search for " Calloc" also brings the solution up rightaway.


"Outside of a dog, a book is a man's best friend. Inside of a dog, it is too
dark to read." -- Groucho Marx

______________________________________________ mailing list
Received on Sun 18 Mar 2012 - 13:21:26 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 18 Mar 2012 - 14:50:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive