This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pool allocator changes and delete[] void*


On Sat, Dec 27, 2003 at 02:22:43PM +0100, Gawain Bolton wrote:
> I'm not understanding something here.  Why replace "new char[n]" with
> "static_cast<char *>(::operator new(n))"?  It seems to me this is less
> readable, less obvious and therefore less maintainable.  What's the
> justification for such obfuscation?

"new char[n]" is not required to be aligned for anything but char.
"operator new(n)" is required to have alignment suitable for any type.

Nathan Myers
ncm-nospam@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]