SST::Core::MemPool Class Reference

Simple Memory Pool class. More...

#include <mempool.h>

Public Member Functions

 MemPool (size_t elementSize, size_t initialSize=(2<< 20))
 Create a new Memory Pool.
void * malloc ()
 Allocate a new element from the memory pool.
void free (void *ptr)
 Return an element to the memory pool.
uint64_t getBytesMemUsed ()
 Approximates the current memory usage of the mempool.
uint64_t getUndeletedEntries ()
size_t getArenaSize () const
size_t getElementSize () const
const std::list< uint8_t * > & getArenas ()

Data Fields

uint64_t numAlloc
 Counter: Number of times elements have been allocated.
uint64_t numFree
 Counter: Number times elements have been freed.

Detailed Description

Simple Memory Pool class.

Constructor & Destructor Documentation

SST::Core::MemPool::MemPool ( size_t  elementSize,
size_t  initialSize = (2<<20) 
) [inline]

Create a new Memory Pool.

elementSize - Size of each Element
initialSize - Size of the memory pool (in bytes)

Member Function Documentation

uint64_t SST::Core::MemPool::getBytesMemUsed (  )  [inline]

Approximates the current memory usage of the mempool.

Some overheads are not taken into account.

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

Generated on 14 Sep 2015 for SST by  doxygen 1.6.1