Hi all,
I'm analysing memwatch, a memory leaks detector, and came across this macro
And then in function mwMalloc, it calls malloc again....Code:#define malloc(n) mwMalloc(n,__FILE__,__LINE__)
Can anyone please enlighten me how is this possible?? How doesCode:void* mwMalloc( size_t size, const char* file, int line) { ..... mw = (mwData*) malloc( needed ); ..... }
know that it's calling a function, not the defined macro??Code:mw = (mwData*) malloc( needed );
Thanks in advance.