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]

RFA (libstdc++): PATCH to implement C++17 over-aligned new


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.

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?

Joseph: My introduction of max_align_t_align will need to be merged
with your change to cxx_fundamental_alignment_p.

Tested x86_64-pc-linux-gnu.

Attachment: aligned-new.diff
Description: Text document


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