Re: [R] R_alloc vs. malloc

From: Prof Brian Ripley <>
Date: Fri, 11 Apr 2008 12:35:34 +0100 (BST)

On Fri, 11 Apr 2008, Søren Højsgaard wrote:

> Dear list
> I have two (trivial) memory-questions related to a call with .C:

On Windows, I presume from past questions from yourself. The answers really are completely Windows-specific, so please do remember to tell us your OS!

> If I allocate memory with R_alloc in a C-program (called with .C), will
> that memory "be taken from" the "available memory pool" (of a maximum of
> 4gb?) which R can allocate? (This is the impression I get from "Writing
> R extensions".)

Yes. Same for Calloc.

> If instead I use malloc; will that memory then be taken from the
> available pool for R? Or does that happen without having an impact on
> R's "available memory pool"?

>From a different pool, but from the same address space. There is no more
virtual memory that R does not have access too, so you would just be setting up in competition.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.

Received on Fri 11 Apr 2008 - 11:46:01 GMT

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 Fri 11 Apr 2008 - 12:30:28 GMT.

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

list of date sections of archive