cpp/memory/monotonic buffer resource

The class is a special-purpose memory resource class that releases the allocated memory only when the resource is destroyed. It is intended for very fast memory allocations in situations where memory is used to build up a few objects and then is released all at once.

can be constructed with an initial buffer. If there is no initial buffer, or if the buffer is exhausted, additional buffers are obtained from an upstream memory resource supplied at construction. The size of buffers obtained follows a geometric progression.

is not thread-safe.

Example
The program measures the time of creating huge double-linked lists using the following allocators:
 * default standard allocator,
 * default allocator,
 * allocator with monotonic resource but without explicit memory buffer,
 * allocator with monotonic resource and external memory buffer (on stack).