[libc++] Make pmr::monotonic_buffer_resource bump down
authorNikolas Klauser <nikolasklauser@berlin.de>
Thu, 12 Jan 2023 17:35:19 +0000 (18:35 +0100)
committerNikolas Klauser <nikolasklauser@berlin.de>
Thu, 12 Jan 2023 17:36:45 +0000 (18:36 +0100)
commit549a5fd0b789578fcb5ee72c9f4446660f759758
tree4a1da1b21847d109fedd1548fe60eb52d5f1d719
parent633927db844e47c87dd93198e2c2763dd10f668f
[libc++] Make pmr::monotonic_buffer_resource bump down

Bumping down is significantly faster than bumping up. This is ABI breaking, but the ABI of `pmr::monotonic_buffer_resource` was only stabilized in this release cycle, so we can still change it.
For a more detailed explanation why bumping down is better, see https://fitzgeraldnick.com/2019/11/01/always-bump-downwards.html.

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D141435
libcxx/benchmarks/CMakeLists.txt
libcxx/benchmarks/monotonic_buffer.bench.cpp [new file with mode: 0644]
libcxx/include/__memory_resource/monotonic_buffer_resource.h
libcxx/src/memory_resource.cpp
libcxx/test/libcxx/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp [moved from libcxx/test/std/utilities/utility/mem.res/mem.res.monotonic.buffer/mem.res.monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp with 56% similarity]