12 #include "allocator_base.hpp"
13 #include "internal/reallocator.hpp"
16 inline namespace v_100 {
28 static constexpr
unsigned int alignment = DefaultAlignment;
30 static constexpr
size_t good_size(
size_t n) {
35 bool aligned_reallocate(
block &b,
size_t n) noexcept
37 block reallocatedBlock{ _aligned_realloc(b.
ptr, n, alignment), n };
39 if (reallocatedBlock) {
49 bool aligned_reallocate(
block &b,
size_t n) noexcept
51 block reallocatedBlock(::realloc(b.
ptr, n));
52 if (reallocatedBlock) {
53 if (static_cast<size_t>(b.
ptr) % alignment != 0) {
55 if (!newAlignedBlock) {
71 static constexpr
bool supports_truncated_deallocation =
false;
80 return block{ _aligned_malloc(n, alignment), n };
82 return block{ (
void *)memalign(alignment, n), n };
98 if (internal::is_reallocation_handled_default(*
this, b, n)) {
102 return aligned_reallocate(b, n);
113 _aligned_free(b.
ptr);
122 using namespace v_100;
block allocate(size_t n) noexcept
void block_copy(const block &source, block &destination) noexcept
bool reallocate(block &b, size_t n) noexcept
constexpr size_t round_to_alignment(size_t basis, size_t n) noexcept
void * ptr
This points to the start address of the described memory block.
void deallocate(block &b) noexcept