A
Andrew Tomazos
Given:
void f(void* p) { ... }
and assuming the operator new has not been overloaded, what are the
concrete differences in behaviour of:
void* p = operator new(iNumBytes);
f(p);
vs
void* p = std:malloc(iNumBytes);
f(p);
That are visible by f?
For example is one reallocable and the other not? Does one consider
alignment restrictions that the other does not? Are there other
differences?
Under g++ and vc++ are the operator new(bytes) and std::malloc
implemented with the same function?
Thanks,
Andrew.
void f(void* p) { ... }
and assuming the operator new has not been overloaded, what are the
concrete differences in behaviour of:
void* p = operator new(iNumBytes);
f(p);
vs
void* p = std:malloc(iNumBytes);
f(p);
That are visible by f?
For example is one reallocable and the other not? Does one consider
alignment restrictions that the other does not? Are there other
differences?
Under g++ and vc++ are the operator new(bytes) and std::malloc
implemented with the same function?
Thanks,
Andrew.