hanchenye-llvm-project/libcxx
Eric Fiselier 7ffcd984c4 LWG 2843 "Unclear behavior of std::pmr::memory_resource::do_allocate()"
Patch by Arthur O'Dwyer.
Reviewed as https://reviews.llvm.org/D47344

new_delete_resource().allocate(n, a) has basically two permissible results:

* Return an appropriately sized and aligned block.
* Throw bad_alloc.

Before this patch, libc++'s new_delete_resource would do a third and impermissible thing, which was
to return an appropriately sized but inappropriately under-aligned block. This is now fixed.

(This came up while I was stress-testing unsynchronized_pool_resource on my MacBook. If we can't
trust the default resource to return appropriately aligned blocks, pretty much everything breaks.
For similar reasons, I would strongly support just patching __libcpp_allocate directly, but I don't
care to die on that hill, so I made this patch as a <memory_resource>-specific workaround.)

llvm-svn: 355763
2019-03-09 00:38:19 +00:00
..
benchmarks [CMake] Use correct visibility for linked libraries in CMake 2019-01-30 23:18:05 +00:00
cmake [compiler-rt] Build custom libcxx with libcxxabi 2019-02-17 12:16:20 +00:00
docs [CMake] Support compiler-rt builtins library in tests 2019-02-05 19:50:47 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include Work around dllimport bug with exclude_from_explicit_instantiation. 2019-03-08 23:59:29 +00:00
lib Revert "[libc++] Do not force building with -fPIC" 2019-03-08 23:27:46 +00:00
src LWG 2843 "Unclear behavior of std::pmr::memory_resource::do_allocate()" 2019-03-09 00:38:19 +00:00
test Fix PR41017 - Build failure with _LIBCPP_DEBUG=0 and non-const-ref 2019-03-08 22:58:59 +00:00
utils [libc++] Only add dylib-related features when using the system's libc++ 2019-03-05 22:42:45 +00:00
www LWG 2843 "Unclear behavior of std::pmr::memory_resource::do_allocate()" 2019-03-09 00:38:19 +00:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt Revert "[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/" 2019-03-08 20:33:55 +00:00
CREDITS.TXT
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT
TODO.TXT
appveyor-reqs-install.cmd Update LLVM version used on Appveyor bot, remove MSVC 2015 bot 2018-10-30 21:23:31 +00:00
appveyor.yml Update LLVM version used on Appveyor bot, remove MSVC 2015 bot 2018-10-30 21:23:31 +00:00