Zen C++ Libraries
Zero-dependency re-usable components for C++
Loading...
Searching...
No Matches
bump_ptr_pool Class Reference

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)

Detailed Description

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.

See also
construct
DynamicAllocator
growing_bump_ptr_pool

The documentation for this class was generated from the following file: