The problem i am facing is,
my function looks something like this:
char *memalloc(int,char *,int)
{
..
..
..
malloc(size);
..
..
}
now in main, i call
main()
{
p3=memalloc(size,__file__,
}
now in my header.h, i define,
#define malloc() (memalloc())
The problem i am facing is, in my memalloc function,i am calling malloc. This "malloc" call also seems to get replaced by memalloc, while inside the memalloc function itself. So is there anyway i can get around this?
TIA
Ankur
Main Topics
Browse All Topics





by: zebadaPosted on 2003-02-06 at 21:49:42ID: 7900639
Use #define
Assume your replacement for malloc is
void *ualloc(int size,int otherparm);
If you specify
#define malloc(s) ualloc(s,123)
then the precompiler will change all instances of malloc to ualloc.
Do the same type of thing for realloc.
Regards
Paul