Hello:

I have a general question about memory allocation.  I'm having a problem
with an R function -- call it myRfunction -- that calls a C routine using
.Call.  For some reason it works the first time I call it, but for every
subsequent time it doesn't.  I'm thinking this has to be a memory allocation
issue.  If I quit R and then reload my package containing myRfunction, again
it works only the first time its called.

Here's how I allocate memory with in the C routine.

for( i=0; i<argC; i++){
    argV[i] = R_alloc(strlen(CHAR_STRING_ELT(argv,i))), sizeof(char)) :
    strcpy( argV[i], CHAR(STRING_ELT(argv,i))) ;
}

Can anyone give me some suggestions about how to debug this issue to see if
its indeed a memory problem? Could it be anything else?

Should I look into vmax, vmaxset etc ?

Thanks to everyone in advance for your help!

Greg

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to