.TH "std::pmr::monotonic_buffer_resource" 3 "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::pmr::monotonic_buffer_resource \- A memory resource that allocates from a fixed-size buffer\&. .SH SYNOPSIS .br .PP .PP \fR#include \fP .PP Inherits \fBstd::pmr::memory_resource\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "\fBmonotonic_buffer_resource\fP (const \fBmonotonic_buffer_resource\fP &)=delete" .br .ti -1c .RI "\fBmonotonic_buffer_resource\fP (\fBmemory_resource\fP *__upstream) noexcept" .br .ti -1c .RI "\fBmonotonic_buffer_resource\fP (size_t __initial_size) noexcept" .br .ti -1c .RI "\fBmonotonic_buffer_resource\fP (size_t __initial_size, \fBmemory_resource\fP *__upstream) noexcept" .br .ti -1c .RI "\fBmonotonic_buffer_resource\fP (void *__buffer, size_t __buffer_size) noexcept" .br .ti -1c .RI "\fBmonotonic_buffer_resource\fP (void *__buffer, size_t __buffer_size, \fBmemory_resource\fP *__upstream) noexcept" .br .ti -1c .RI "void * \fBallocate\fP (size_t __bytes, size_t __alignment=_S_max_align)" .br .ti -1c .RI "void \fBdeallocate\fP (void *__p, size_t __bytes, size_t __alignment=_S_max_align)" .br .ti -1c .RI "bool \fBis_equal\fP (const \fBmemory_resource\fP &__other) const noexcept" .br .ti -1c .RI "\fBmonotonic_buffer_resource\fP & \fBoperator=\fP (const \fBmonotonic_buffer_resource\fP &)=delete" .br .ti -1c .RI "void \fBrelease\fP () noexcept" .br .ti -1c .RI "\fBmemory_resource\fP * \fBupstream_resource\fP () const noexcept" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "void * \fBdo_allocate\fP (size_t __bytes, size_t __alignment) override" .br .ti -1c .RI "void \fBdo_deallocate\fP (void *, size_t, size_t) override" .br .ti -1c .RI "bool \fBdo_is_equal\fP (const \fBmemory_resource\fP &__other) const noexcept override" .br .in -1c .SH "Detailed Description" .PP A memory resource that allocates from a fixed-size buffer\&. The main feature of a \fRpmr::monotonic_buffer_resource\fP is that its \fRdo_deallocate\fP does nothing\&. This makes it very fast because there is no need to manage a free list, and every allocation simply returns a new block of memory, rather than searching for a suitably-sized free block\&. Because deallocating is a no-op, the amount of memory used by the resource only grows until \fRrelease()\fP (or the destructor) is called to return all memory to upstream\&. .PP A \fRmonotonic_buffer_resource\fP can be initialized with a buffer that will be used to satisfy all allocation requests, until the buffer is full\&. After that a new buffer will be allocated from the upstream resource\&. By using a stack buffer and \fRpmr::null_memory_resource()\fP as the upstream you can get a memory resource that only uses the stack and never dynamically allocates\&. .PP \fBSince\fP .RS 4 C++17 .RE .PP .SH "Member Function Documentation" .PP .SS "void * std::pmr::monotonic_buffer_resource::do_allocate (size_t __bytes, size_t __alignment)\fR [inline]\fP, \fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP" .PP Implements \fBstd::pmr::memory_resource\fP\&. .SS "void std::pmr::monotonic_buffer_resource::do_deallocate (void * , size_t , size_t )\fR [inline]\fP, \fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP" .PP Implements \fBstd::pmr::memory_resource\fP\&. .SS "bool std::pmr::monotonic_buffer_resource::do_is_equal (const \fBmemory_resource\fP & __other) const\fR [inline]\fP, \fR [override]\fP, \fR [protected]\fP, \fR [virtual]\fP, \fR [noexcept]\fP" .PP Implements \fBstd::pmr::memory_resource\fP\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.