CETL 0.0.0
 
Loading...
Searching...
No Matches
cetl::pf17::pmr::deviant::basic_monotonic_buffer_resource Class Reference

#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_resourceoperator= (const basic_monotonic_buffer_resource &)=delete
 
void release () noexcept
 
memory_resourceupstream_resource () const
 
- Public Member Functions inherited from cetl::pf17::pmr::memory_resource
 memory_resource ()=default
 
 memory_resource (const memory_resource &rhs)=default
 
virtual ~memory_resource ()=default
 
memory_resourceoperator= (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
 

Detailed Description

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.

Member Function Documentation

◆ do_allocate()

void * cetl::pf17::pmr::deviant::basic_monotonic_buffer_resource::do_allocate ( std::size_t size_bytes,
std::size_t alignment )
inlineoverrideprotectedvirtual

◆ do_deallocate()

void cetl::pf17::pmr::deviant::basic_monotonic_buffer_resource::do_deallocate ( void * p,
std::size_t size_bytes,
std::size_t alignment )
inlineoverrideprotectedvirtual

◆ do_is_equal()

bool cetl::pf17::pmr::deviant::basic_monotonic_buffer_resource::do_is_equal ( const memory_resource & rhs) const
inlineoverrideprotectedvirtualnoexcept

◆ do_max_size()

std::size_t cetl::pf17::pmr::deviant::basic_monotonic_buffer_resource::do_max_size ( ) const
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.

Returns
See cetl::pf17::pmr::memory_resource::max_size.

Reimplemented from cetl::pf17::pmr::memory_resource.

References std::numeric_limits::max(), and cetl::pf17::pmr::deviant::memory_resource_traits< T >::max_size().


The documentation for this class was generated from the following file: