diff options
author | Louis Dionne <ldionne@apple.com> | 2020-11-12 15:14:33 -0500 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2020-11-25 15:44:50 -0500 |
commit | a78aaa1ad51214b2e04f41762e76bb43067ea1fd (patch) | |
tree | 44a100ef75cb5b8c406a4dbc89b6d6288564b6dd /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | cbf336ad76cd619495b213e8364acaccb7a7c0d6 (diff) | |
download | llvm-a78aaa1ad51214b2e04f41762e76bb43067ea1fd.zip llvm-a78aaa1ad51214b2e04f41762e76bb43067ea1fd.tar.gz llvm-a78aaa1ad51214b2e04f41762e76bb43067ea1fd.tar.bz2 |
[libc++] Factor out common logic for calling aligned allocation
There were a couple of places where we needed to call the underlying
platform's aligned allocation/deallocation function. Instead of having
the same logic all over the place, extract the logic into a pair of
helper functions __libcpp_aligned_alloc and __libcpp_aligned_free.
The code in libcxxabi/src/fallback_malloc.cpp looks like it could be
simplified after this change -- I purposefully did not simplify it
further to keep this change as straightforward as possible, since it
is touching very important parts of the library.
Also, the changes in libcxx/src/new.cpp and libcxxabi/src/stdlib_new_delete.cpp
are basically the same -- I just kept both source files in sync.
The underlying reason for this refactoring is to make it easier to support
platforms that provide aligned allocation through C11's aligned_alloc
function instead of posix_memalign. After this change, we'll only have
to add support for that in a single place.
Differential Revision: https://reviews.llvm.org/D91379
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions