[PATCH] D47111: <experimental/memory_resource>: Implement monotonic_buffer_resource.
Arthur O'Dwyer via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 28 21:12:02 PDT 2018
Quuxplusone updated this revision to Diff 148843.
Quuxplusone added a comment.
Add `override`; disintegrate the unit test; adopt some tests from Eric's https://reviews.llvm.org/D27402.
Also fix one QOI issue discovered by Eric's tests: if the user passes an `initial_size` to the constructor, then they are //probably// intending that our first upstream-allocation be big enough to serve at least `initial_size` 1-byte allocations (or one `initial_size`-byte allocation with a suitably small alignment). This is explicitly //not// mandated by the Standard (it merely requires that our next upstream-allocation be of size at least `initial_size`), but it's probably a healthy choice.
Repository:
rCXX libc++
https://reviews.llvm.org/D47111
Files:
include/experimental/memory_resource
src/experimental/memory_resource.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.ctor/copy_move.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.ctor/with_default_resource.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.ctor/without_buffer.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_deallocate.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_exception_safety.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_from_initial_buffer.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_from_underaligned_buffer.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_from_zero_sized_buffer.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_in_geometric_progression.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/allocate_overaligned_request.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/monotonic.buffer.mem/equality.pass.cpp
test/std/experimental/memory/memory.resource.monotonic.buffer/nothing_to_do.pass.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47111.148843.patch
Type: text/x-patch
Size: 30765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180529/640cea3f/attachment-0001.bin>
More information about the cfe-commits
mailing list