hanchenye-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
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
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
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
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
list
map
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
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
set
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
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
unordered_set
utility
vector