Tool/software: TI C/C++ Compiler
Hi All
I am working on overloading delete operator on A15 core which uses gcc-arm-none-eabi-4_7-2013q3 as the compiler.Below is the piece of code which i used
void operator delete(void *pfs)
{
printf("deleted address: %x \n", pfs);
free(pfs);
return;
}
void operator delete[](void *pfs)
{
operator delete(pfs);
}
void deletep(const char *file, int lineno)
{
const char *fname_delete;
fname_delete = print_file_name(file);
printf("Memory deleted @ file %s \t ", fname_delete);
printf("Line number %d \n ", lineno);
return;
}
#define new new(__FILE__, __LINE__)
#define delete deletep(__FILE__, __LINE__),delete
In the above code it compiles but when i execute this code the deletep function is not called. When i run the same piece of code on linux platform which uses gcc 4.6 it executes the function(deletep) and then delete operator is gets overloaded with user provided function. I would like to know what is causing this wired behavior?