[R] memory allocation and interrupts

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jun 12 09:12:08 CEST 2004

On Fri, 11 Jun 2004, Vadim Ogranovich wrote:

> A recent discussion on the list about tryCatch and signals made me think
> about memory allocation and signals in C extension modules. What happens
> to the memory allocated by R_alloc and Calloc if the user pressed Ctr-C
> during the call? R-ext doesn't seem to discuss this. I'd guess that
> R_alloc is interrupt-safe while Calloc is not, but I am not sure. In any
> case a paragraph in R-ext on signals would be helpful.

Easy: such code is not interruptible by Ctrl-C (sic).  And that *is* in
R_exts.* (sic), even with an entry `interrupts' in its index!

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

More information about the R-help mailing list