A
asm23
Hi, all.
I have a simple code, it is used in a replacement of the new operator to
support a debug version of new.
#define NEW new (dmalloc, __FILE__, __LINE__)
#define new NEW
void f ()
{
int *intp = new int;
}
Using gcc -E command will give the code below:
void f ()
{
int *intp = new (dmalloc, "a.c", 8) int;
}
My question is:
Why we need *two* macros.
Should one macro be enough:
#define new new (dmalloc, __FILE__, __LINE__)
And what's the replace sequence of these two macros?(How the C
preprocessor do the replacement?)
Thanks in advance.
I have a simple code, it is used in a replacement of the new operator to
support a debug version of new.
#define NEW new (dmalloc, __FILE__, __LINE__)
#define new NEW
void f ()
{
int *intp = new int;
}
Using gcc -E command will give the code below:
void f ()
{
int *intp = new (dmalloc, "a.c", 8) int;
}
My question is:
Why we need *two* macros.
Should one macro be enough:
#define new new (dmalloc, __FILE__, __LINE__)
And what's the replace sequence of these two macros?(How the C
preprocessor do the replacement?)
Thanks in advance.