On Sat, Mar 17, 2012 at 11:47:24PM -0400, Simon Urbanek wrote:
[...]
> You can always define Strdup() since strdup() is just a shorthand for
> malloc()+strcpy() -- in fact in R it's easier since Calloc will never return
> NULL so trivially
> #define Strdup(X) strcpy(Calloc(strlen(X)+1, char), X)
[.
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 s
On Sat, Mar 17, 2012 at 10:08:05PM -0500, Dirk Eddelbuettel wrote:
>
> On 18 March 2012 at 03:30, oliver wrote:
> | Hello,
> |
> | when looking at "Writing R Extensions"
> | with mem-allocation in mind, I wondered,
> | which functions to use to substitute
> | malloc(), calloc(), realloc() and str
On Mar 17, 2012, at 10:30 PM, oliver wrote:
> Hello,
>
> when looking at "Writing R Extensions"
> with mem-allocation in mind, I wondered,
> which functions to use to substitute
> malloc(), calloc(), realloc() and strdup() and free().
>
> It looked like Calloc() or R_Calloc() might be useful fo
On 18 March 2012 at 03:30, oliver wrote:
| Hello,
|
| when looking at "Writing R Extensions"
| with mem-allocation in mind, I wondered,
| which functions to use to substitute
| malloc(), calloc(), realloc() and strdup() and free().
|
| It looked like Calloc() or R_Calloc() might be useful for
|