Dear CINTers,
Maybe I’m doing something that’s not supposed to work, but I’m curious about what’s happening. The below test script works just fine when compiled root -b -q test.C+
but when running straight through CINT root -b -q test.C
it mucks up the memory and dies. On lxplus with 5.32/00 it says that glibc detected a ‘ouble free or corruption’, on my Mac with 5.99/01 it’s malloc who claims that a ‘pointer being freed was not allocated’.
Does CINT create multiple structs on-the-fly in the loop? And why/how does that differ from what the compiled version does.
Best regards,
Jeroen
[code]struct TestStruct {
std::string dummy;
};
TestStruct Structor() {
TestStruct t;
return t;
}
void test() {
TestStruct t;
for(size_t i = 0; i != 2; ++i) {
t = Structor();
}
}[/code]