mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 22:30:13 +00:00
955dd7b7f3
This patch updates `allocate_shared` to call `allocator_traits::construct` when creating the object held inside the shared_pointer, and `allocator_traits::destroy` when destroying it. This resolves the part of P0674R1 that was originally filed as LWG2070. This change is landed separately from the rest of P0674R1 because it is incredibly tricky from an ABI perspective. This is the reason why this change is so tricky is that we previously used EBO in a compressed pair to store both the allocator and the object type stored in the `shared_ptr`. However, starting in C++20, P0674 requires us to use Allocator construction for initializing the object type. That requirement rules out the use of the EBO for the object type, since using the EBO implies that the base will be initialized when the control block is initialized (and hence we can't do it through Allocator construction). Hence, supporting P0674 requires changing how we store the object type inside the control block, which we do while being ABI compatible by using some trickery with a properly aligned char buffer. Fixes https://llvm.org/PR41900 Supersedes https://llvm.org/D62760 Differential Revision: https://reviews.llvm.org/D91201 |
||
---|---|---|
.. | ||
benchmarks | ||
cmake | ||
docs | ||
include | ||
lib | ||
src | ||
test | ||
utils | ||
www | ||
.clang-format | ||
.gitignore | ||
appveyor-reqs-install.cmd | ||
appveyor.yml | ||
CMakeLists.txt | ||
CREDITS.TXT | ||
LICENSE.TXT | ||
TODO.TXT |