A memory resource that allocates from a fixed-size buffer.
The main feature of a pmr::monotonic_buffer_resource is that its do_deallocate 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 release() (or the destructor) is called to return all memory to upstream.
A monotonic_buffer_resource 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 pmr::null_memory_resource() as the upstream you can get a memory resource that only uses the stack and never dynamically allocates.