It's well known that new
(/delete
) and malloc
(/free
) don't mix.
What was the reason to not make them compatible?
I understand that new
and delete
have two responsibilities: constructing and destructing in addition to allocating and deallocating so to make the question more accurate: Why aren't the ::operator new
and ::operator delete
functions required to call ::malloc
and ::free
respectively?
Forcing compatibility would at least allow realloc
ing of new
ed arrays of primitive (or rellocatable nonprimitive) types, which can carry noninsignificant performance benefits, and it would make things a little simpler for people who absolutely want to free
new
ed memory (when destruction isn't required).
So what is the reason to break compatibility with malloc
here?