diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-07-22 14:38:34 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-07-22 14:38:34 +0100 |
commit | c9ca352186226ae757688e160e7c6f394c9f26aa (patch) | |
tree | 5c348a4cd218bf519e980632707a36b962000e00 /gcc | |
parent | aca7a0253d6e3116f846ad530b19d89644a64267 (diff) | |
download | gcc-c9ca352186226ae757688e160e7c6f394c9f26aa.zip gcc-c9ca352186226ae757688e160e7c6f394c9f26aa.tar.gz gcc-c9ca352186226ae757688e160e7c6f394c9f26aa.tar.bz2 |
libstdc++: Use __builtin_operator_new when available [PR94295]
Clang provides __builtin_operator_new and __builtin_operator_delete,
which have the same semantics as ::operator new and ::operator delete
except that the compiler is allowed to elide calls to them. This changes
std::allocator to use those built-in functions so that memory allocated
by std::allocator can be optimized away when using Clang. This avoids an
abstraction penalty for using std::allocator to allocate storage rather
than a new-expression.
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:
PR libstdc++/94295
* include/ext/new_allocator.h (_GLIBCXX_OPERATOR_NEW)
(_GLIBCXX_OPERATOR_DELETE, _GLIBCXX_SIZED_DEALLOC): Define.
(allocator::allocate, allocator::deallocate): Use new macros.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions