.TH "std::pmr::monotonic_buffer_resource" 3cxx "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
\fC#include <memory_resource>\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 &)=\fBdelete\fP"
.br
.ti -1c
.RI "\fBmonotonic_buffer_resource\fP (\fBmemory_resource\fP *\fB__upstream\fP) noexcept"
.br
.ti -1c
.RI "\fBmonotonic_buffer_resource\fP (size_t \fB__initial_size\fP) noexcept"
.br
.ti -1c
.RI "\fBmonotonic_buffer_resource\fP (size_t \fB__initial_size\fP, \fBmemory_resource\fP *\fB__upstream\fP) noexcept"
.br
.ti -1c
.RI "\fBmonotonic_buffer_resource\fP (\fBvoid\fP *\fB__buffer\fP, size_t \fB__buffer_size\fP) noexcept"
.br
.ti -1c
.RI "\fBmonotonic_buffer_resource\fP (\fBvoid\fP *\fB__buffer\fP, size_t \fB__buffer_size\fP, \fBmemory_resource\fP *\fB__upstream\fP) noexcept"
.br
.ti -1c
.RI "\fBvoid\fP * \fBallocate\fP (size_t \fB__bytes\fP, size_t \fB__alignment\fP=_S_max_align)"
.br
.ti -1c
.RI "\fBvoid\fP \fBdeallocate\fP (\fBvoid\fP *__p, size_t \fB__bytes\fP, size_t \fB__alignment\fP=_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 &)=\fBdelete\fP"
.br
.ti -1c
.RI "\fBvoid\fP \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 "\fBvoid\fP * \fBdo_allocate\fP (size_t \fB__bytes\fP, size_t \fB__alignment\fP) \fBoverride\fP"
.br
.ti -1c
.RI "\fBvoid\fP \fBdo_deallocate\fP (\fBvoid\fP *, size_t, size_t) \fBoverride\fP"
.br
.ti -1c
.RI "bool \fBdo_is_equal\fP (const \fBmemory_resource\fP &__other) const noexcept \fBoverride\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A memory resource that allocates from a fixed-size buffer\&. 

The main feature of a \fCpmr::monotonic_buffer_resource\fP is that its \fCdo_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 \fCrelease()\fP (or the destructor) is called to return all memory to upstream\&.
.PP
A \fCmonotonic_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 \fCpmr::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 "\fBvoid\fP * std::pmr::monotonic_buffer_resource::do_allocate (size_t __bytes, size_t __alignment)\fC [inline]\fP, \fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP"

.PP
Implements \fBstd::pmr::memory_resource\fP\&.
.SS "\fBvoid\fP std::pmr::monotonic_buffer_resource::do_deallocate (\fBvoid\fP *, size_t, size_t)\fC [inline]\fP, \fC [override]\fP, \fC [protected]\fP, \fC [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\fC [inline]\fP, \fC [override]\fP, \fC [protected]\fP, \fC [virtual]\fP, \fC [noexcept]\fP"

.PP
Implements \fBstd::pmr::memory_resource\fP\&.

.SH "Author"
.PP 
Generated automatically by Doxygen for libstdc++ from the source code\&.