D
Dodo
I have overloaded the global new/delete operators with
something like this (simplified):
void *operator new(size_t size)
{
...allocation code...
}
void operator delete(void * p)
{
...allocation code...
}
void *operator new[](size_t size)
{
...deallocation code...
}
void operator delete[](void * p)
{
...dealocation code...
}
Now given these overloaded ops, I try following code:
char *p = new char[100];
....
delete [] p;
What is the correct new/delete pair of allocators that will be used?
My problem is that under VC6, SP5 I always get new(size_t)/delte(void *)
as allocators/dealocators. Same code under VC7.1 (.NET 2003) and
Intel C++ 7.1 links to new(size_t)/delete[](void *). At this point I am
puzzled.
Isn't the correct linkage new[](size_t)/delete[](void *) even for scalar
types?
Thanks!
something like this (simplified):
void *operator new(size_t size)
{
...allocation code...
}
void operator delete(void * p)
{
...allocation code...
}
void *operator new[](size_t size)
{
...deallocation code...
}
void operator delete[](void * p)
{
...dealocation code...
}
Now given these overloaded ops, I try following code:
char *p = new char[100];
....
delete [] p;
What is the correct new/delete pair of allocators that will be used?
My problem is that under VC6, SP5 I always get new(size_t)/delte(void *)
as allocators/dealocators. Same code under VC7.1 (.NET 2003) and
Intel C++ 7.1 links to new(size_t)/delete[](void *). At this point I am
puzzled.
Isn't the correct linkage new[](size_t)/delete[](void *) even for scalar
types?
Thanks!