llvm-project/libcxx
Eric Fiselier 7e6448bb02 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: 345214
2018-10-24 22:44:01 +00:00
..
benchmarks Add benchmark for std::set. 2018-10-23 14:49:27 +00:00
cmake [CMake] Use just basename when copying C++ ABI headers 2018-10-04 05:38:53 +00:00
docs [libcxx] Remove custom CMake code targeting Mac OS 10.6 2018-10-16 00:31:32 +00:00
fuzzing Wrote my own version of is_permutation; that was dominating the timings 2018-01-19 03:17:45 +00:00
include Implement sized deallocation for std::allocator and friends. 2018-10-24 22:44:01 +00:00
lib [libcxx] Remove custom CMake code targeting Mac OS 10.6 2018-10-16 00:31:32 +00:00
src Implement sized deallocation for std::allocator and friends. 2018-10-24 22:44:01 +00:00
test Implement sized deallocation for std::allocator and friends. 2018-10-24 22:44:01 +00:00
utils [libcxx] Improve reporting when running the lit test suite 2018-10-17 16:12:04 +00:00
www Updated the issue notes. 2018-10-23 01:30:14 +00:00
.arcconfig [libcxx] Set up .arcconfig to point to new Diffusion CXX repository 2017-12-04 17:55:28 +00:00
.clang-format Make clang-format use C++03 syntax 2017-04-15 02:45:43 +00:00
.gitignore Implement N4606 optional 2016-10-12 07:46:20 +00:00
CMakeLists.txt Remove one more warning from clang-cl build 2018-10-01 03:59:05 +00:00
CREDITS.TXT Try again, this time with the correct address 2017-12-29 19:26:53 +00:00
LICENSE.TXT Update year to 2017 2017-01-03 11:20:43 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT Add list of filesystem NB comments to TODO.TXT so they can be tracked separately 2017-03-06 21:23:36 +00:00
appveyor-reqs-install.cmd Update Clang version on Appveyor bots 2018-04-04 04:33:09 +00:00
appveyor.yml Rename Appveyor install helper script. 2017-05-10 02:43:02 +00:00