Mixin to assign pool allocator to a class. More...
#include <senf/Utils/pool_alloc_mixin.hh>
Classes | |
struct | pool |
Templated typedef for the pool used. More... | |
Static Public Member Functions | |
static void * | operator new (size_t size) |
Operator new utilizing pool allocation. More... | |
static void | operator delete (void *p, size_t size) |
Operator delete utilizing pool allocation. More... | |
Mixin to assign pool allocator to a class.
This mixin will overload a classes operator new
and operator delete
so as to make the class use the Boost.Pool memory allocator by default. Using this allocator does however introduce a few restrictions:
Usage:
\note pool_alloc_mixin uses the <a href="http://www.boost.org/doc/libs/release/libs/pool/doc/index.html">Boost.Pool</a> <i>singleton pool</i> interface with the tag <tt>pool_alloc_mixin_tag</tt>. This class is accessible via the <tt>pool</tt> member. Using this member, it is simple to call relevant pool functions, e.g. <tt>SomeClass::pool<>::release_memory()</tt>.
Definition at line 58 of file pool_alloc_mixin.hh.
|
static |
Operator delete utilizing pool allocation.
|
static |
Operator new utilizing pool allocation.