#include "cetl/pf17/memory_resource.hpp"
Public Member Functions | |
basic_monotonic_buffer_resource (void *buffer, size_t buffer_size, memory_resource *upstream=null_memory_resource()) | |
basic_monotonic_buffer_resource (std::size_t initial_size, memory_resource *upstream) | |
basic_monotonic_buffer_resource (memory_resource *upstream) | |
basic_monotonic_buffer_resource (const basic_monotonic_buffer_resource &)=delete | |
basic_monotonic_buffer_resource & | operator= (const basic_monotonic_buffer_resource &)=delete |
void | release () noexcept |
memory_resource * | upstream_resource () const |
![]() | |
memory_resource ()=default | |
memory_resource (const memory_resource &rhs)=default | |
virtual | ~memory_resource ()=default |
memory_resource & | operator= (const memory_resource &rhs)=default |
void * | allocate (std::size_t size_bytes, std::size_t alignment=alignof(std::max_align_t)) |
void | deallocate (void *p, std::size_t size_bytes, std::size_t alignment=alignof(std::max_align_t)) |
bool | is_equal (const memory_resource &rhs) const noexcept |
std::size_t | max_size () const noexcept |
void * | reallocate (void *ptr, std::size_t old_size_bytes, std::size_t new_size_bytes, std::size_t alignment=alignof(std::max_align_t)) |
Protected Member Functions | |
void * | do_allocate (std::size_t size_bytes, std::size_t alignment) override |
void | do_deallocate (void *p, std::size_t size_bytes, std::size_t alignment) override |
bool | do_is_equal (const memory_resource &rhs) const noexcept override |
std::size_t | do_max_size () const noexcept override |
Adheres to the C++17 std::pmr::monotonic_buffer_resource specification except that it does not provide default upstream constructors and therefore has no dependencies to types defined in cetl/pf17/sys/memory_resource.hpp.
|
inlineoverrideprotectedvirtual |
Template method to implement in terms of cetl::pf17::pmr::memory_resource::allocate.
size_bytes | See cetl::pf17::pmr::memory_resource::allocate. |
alignment | See cetl::pf17::pmr::memory_resource::allocate. |
See | cetl::pf17::pmr::memory_resource::allocate. |
Implements cetl::pf17::pmr::memory_resource.
References std::max(), cetl::pf17::pmr::memory_resource::max_size(), and std::min().
|
inlineoverrideprotectedvirtual |
Template method to implement in terms of cetl::pf17::pmr::memory_resource::deallocate.
p | See cetl::pf17::pmr::memory_resource::deallocate. |
size_bytes | See cetl::pf17::pmr::memory_resource::deallocate. |
alignment | See cetl::pf17::pmr::memory_resource::deallocate. |
See | cetl::pf17::pmr::memory_resource::deallocate. |
Implements cetl::pf17::pmr::memory_resource.
|
inlineoverrideprotectedvirtualnoexcept |
Template method to implement in terms of cetl::pf17::pmr::memory_resource::is_equal.
rhs | See cetl::pf17::pmr::memory_resource::is_equal. |
Implements cetl::pf17::pmr::memory_resource.
References cetl::pf17::pmr::memory_resource::memory_resource().
|
inlineoverrideprotectedvirtualnoexcept |
Default implementation of cetl::pf17::pmr::memory_resource::max_size that simply returns std::numeric_limits<std::size_t>::max()
.
Implementations can override this method and do not need to call the base class.
Reimplemented from cetl::pf17::pmr::memory_resource.
References std::numeric_limits::max(), and cetl::pf17::pmr::deviant::memory_resource_traits< T >::max_size().