This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>, libstdc++ at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Thu, 8 Sep 2016 09:10:01 +0200 (CEST)
- Subject: Re: RFA (libstdc++): PATCH to implement C++17 over-aligned new
- Authentication-results: sourceware.org; auth=none
- References: <CADzB+2kJRV14hZX1rGz5V_UCpSB7MdVQPh4OM=vYOsw6ZDUNkA@mail.gmail.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
On Thu, 8 Sep 2016, Jason Merrill wrote:
This patch adds support for C++17 allocation of types with alignment
greater than max_align_t using 'new'. This is on by default in C++17
and can also be enabled for other -std= with -falign-new.
Great :-)
If a user wants to use a different boundary than alignof(max_align_t),
perhaps because their malloc provides more or less alignment than
glibc's, they can specify -falign-new=<N>.
The patch also adds a warning about allocating an over-aligned type
without using an aligned new-operator, which is enabled by -Wall.
libstdc++ folk: Does my configury handling of different C library
functions that might be usable for aligned allocation make sense? Is
the (standard-conforming) implementation of the nothrow allocation
function OK despite Jonathan's comment in bug 68210? OK for trunk?
Do we want a generic fallback implementation (similar to
gcc/config/i386/gmm_malloc.h)? A windows version with _aligned_malloc /
_aligned_free would also be possible.
--
Marc Glisse