[Rd] Memory Protection calling C-fun from C

2004-04-01 Thread Torsten Hothorn
Good morning! The descriptions of memory protection all assume that one is calling a C-function directly from R. I'm not sure if my understanding of calling a C-function from another C-function is correct: Suppose there are two functions SEXP bar(SEXP y) { SEXP b; PROTECT(b =

Re: [Rd] Memory Protection calling C-fun from C

2004-04-01 Thread Prof Brian Ripley
Torsten, Of course, R itself is a C program so the principles apply to interpreted calls too, with your code in bar returning control to do_dotcall in your first example. There can be no R memory allocation between returning from bar and assigning to a in foo, and it is memory allocation (and