![]() |
Zen C++ Libraries
Zero-dependency re-usable components for C++
|
A chunk of memory for storing variable-width objects which get destroyed all at once. More...
#include <bump_ptr_pool.hpp>
Public Member Functions | |
| bump_ptr_pool (std::size_t sz=ZEN_DEFAULT_POOL_CHUNK_SIZE) | |
| bool | empty () const |
| std::size_t | max_bytes_free () const |
| std::size_t | capacity () const |
| void * | allocate (std::size_t sz, std::size_t alignment, destroy_fn destroy) |
Static Public Member Functions | |
| static std::size_t | min_size_for (std::size_t sz) |
A chunk of memory for storing variable-width objects which get destroyed all at once.
The objects are stored in a continuous byte array with a pointer keeping track of the free space at the end. The pointer is bumped with each allocation, hence the name.