llvm-project/libcxx/include/experimental
Eric Fiselier f25b75b91b Implement sized deallocation for std::allocator and friends.
Summary:
C++14 sized deallocation is disabled by default due to ABI concerns. However, when a user manually enables it then libc++ should take advantage of it since sized deallocation can provide a significant performance win depending on the underlying malloc implementation. (Note that libc++'s definitions of sized delete don't do anything special yet, but users are free to provide their own).

This patch updates __libcpp_deallocate to selectively call sized operator delete when it's available. `__libcpp_deallocate_unsized` should be used when the size of the allocation is unknown.

On Apple this patch makes no attempt to determine if the sized operator delete is unavailable, only that the language feature is enabled. This could cause a compile error when using `std::allocator`, but the same compile error would occur whenever the user calls `new`, so I don't think it's a problem.

Reviewers: ldionne, mclow.lists

Reviewed By: ldionne

Subscribers: rsmith, ckennelly, libcxx-commits, christof

Differential Revision: https://reviews.llvm.org/D53120

llvm-svn: 345281
2018-10-25 17:21:30 +00:00
..
__config Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to." 2018-07-30 22:27:38 +00:00
__memory Add <experimental/memory_resource> 2016-05-07 01:04:55 +00:00
algorithm Remove std::experimental::sample; use std::sample instead. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-01 16:36:08 +00:00
any Remove <experimental/any>; use <any> instead. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-01 15:21:14 +00:00
chrono Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
coroutine [libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY 2018-07-10 17:38:30 +00:00
deque Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
dynarray Implement sized deallocation for std::allocator and friends. 2018-10-25 17:21:30 +00:00
filesystem Implement <filesystem> 2018-07-27 03:07:09 +00:00
forward_list Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
functional While implementing P0777 - preventing unnecessary decay, I found some non-public uses of decay that could be replaced by __uncvref. NFC intented 2018-02-12 15:41:25 +00:00
iterator Rename identifiers named `__output` 2017-11-14 11:14:25 +00:00
list Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
map Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
memory_resource Remove unused code from __functional_base. NFC. 2018-06-06 06:42:27 +00:00
numeric Remove <experimental/numeric>; use <numeric> instead. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-01 15:49:27 +00:00
optional Remove <experimental/optional>; use <optional> instead. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-01 14:54:25 +00:00
propagate_const Implement LWG#2518 - Non-member swap for propagate_const should call member swap 2018-03-08 15:01:50 +00:00
ratio Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
regex Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
set Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
simd Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to." 2018-07-30 22:27:38 +00:00
string Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
string_view Remove <experimental/string_view>; use <string_view> instead. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-05 23:43:34 +00:00
system_error Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
tuple Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
type_traits Remove more of the std::experimental bits that are now in std::. All the _v type aliases, conjunction/disjunction, apply, etc. See https://libcxx.llvm.org/TS_deprecation.html 2018-02-06 23:13:48 +00:00
unordered_map Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
unordered_set Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00
utility [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS 2017-01-04 23:56:00 +00:00
vector Add experimental container alias templates for PMRs 2016-05-07 03:09:55 +00:00