Dictionary segmentation fault with macro

Hi,

I overload the allocation function new to add debug features to my application. My new function is like that :

inline void* operator new(std::size_t Size, const char* File, int Line) { //... }

To keep it completely transparent for the user I add the following macro :

but this macro produces a segmentation fault at the dictionary generation. I have tried to replace “new(FILE, LINE)” by a simple function “test()” without paramaters and it works.

If somebody has an idea…

thanks

Hi,

could you surround this macro definition by #ifndef CINT? In principle your debug new should not be relevant for the dictionary.

Btw, I don’t see how your definition of new could work e.g. with new-with-placement, and I don’t see your definition of the new function match the CPP macro. But that could just come from your example being too compressed. Also, there are system defined ways of overloading the new operator or the new function; I think these are more appropriate than redefining new as a CPP macro.

Cheers, Axel.