This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: pool allocator changes and delete[] void*
----- Original Message -----
From: "Nathan Myers" <ncm-nospam@cantrip.org>
To: <libstdc++@gcc.gnu.org>
Sent: Saturday, December 27, 2003 6:18 PM
Subject: 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.
That alone is good enough reason for me. Thanks for the info.