Template Class memory_pool
Defined in File common.hpp
Class Documentation
-
template<typename Container>
class apex::containers::memory_pool A combined storage and pool class. This class over-allocates memory by a factor of two. This is because STL containers do not uniformly allocate memory for each new node.
- Template Parameters
Container – The apex::containers type to set up this pool for
Public Functions
-
inline explicit memory_pool(const std::size_t capacity)
Constructor.
- Parameters
capacity – [in] The number of elements for the given container type that this memory pool is prealloacted to store
-
inline operator node_pool_t&()
Implicit conversion to the underlying RawAllocator.
-
template<typename ...Args>
inline decltype(auto) create(Args&&... args) Construct the container with the given arguments.
- Template Parameters
Args – A parameter pack for forwarded constructor arguments
- Parameters
args – [in] Arguments passed directly to the container constructor (except for allocator)