[Rd] Ctrl-C of functions that allocated mem

From: oliver <oliver_at_first.in-berlin.de>
Date: Thu, 09 Jun 2011 02:06:27 +0200


what happens, when a function (R-extension in C), that allocated memory (strdup(), malloc()/calloc() and so on), and is used in interactive mode, then will be stopped via Ctrl-C?

I would assume that there remains allocated memory, which is not usable and also not accessable (hence no way to free it).

Are there any mechanisms in R that could help in rolling back the allocation?

Normally in an interactive session "some memory" might not be a problem, because it will be run shortly; but I prefer clean solutions. And also, if it's much mem, which is allocated each time, and one does many trials and Ctr-C's, even an interactive session might eat a lot of mem.

So I would be interested in a solution to this (potential) problem.



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 09 Jun 2011 - 00:08:37 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 Thu 09 Jun 2011 - 02:20:18 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive