I searched for this problem and looked through the manual of R-extensions, but could not find information about it.
I have a large enough program that makes a lot of C code calls with .C. I transmit quite a lot of data that does not change during the program. Therefore, I decided to force them to the correct data type only once:
vec = as.integer (as.vector (vec)).
Then in the .C call I write:
.C ('function', vec = vec)
Unlike
.C ('function', vec = as.integer (as.vector (vec))).
This was done as profiling, shown as. * took a little time. However, I get (after several hundred thousand iterations) a glibc error in malloc:
* glibc / usr / lib / R / bin / exec / R detected : malloc (): memory corruption: 0x0cabc0d8 **
Iβm just wondering why this happens, because the object that I forced to start does not change during the program, and if there is a way around this, I can minimize mine. * challenges.
Thanks,
Chris
source share