My Project
|
this is a thread safe version of boost::pool. More...
#include <PoolBase.h>
Public Types | |
typedef UserAllocator::size_type | size_type |
typedef UserAllocator::difference_type | difference_type |
typedef Mutex | mutex_type |
typedef boost::pool< UserAllocator > | pool_type |
Public Member Functions | |
PoolThreadSafe (const size_type nrequested_size, const size_type nnext_size=32) | |
void * | malloc () |
void | free (void *const chunk) |
this is a thread safe version of boost::pool.
It derives from boost:pool, but use a lock for its malloc and free function. e.g. PoolThreadSafe<> s_memPool(32); char* A = s_memPool.malloc(); s_memPool.free(A);