#include <Sacado_Fad_MemPool.hpp>
Public Member Functions | |
| MemPool (unsigned int elem_size, unsigned int n_elem, unsigned int pre_alloc=0) | |
Constructor. elem_size is the size of elements, n_elem is the number of elements per chunk. pre_alloc is the number of chunks to pre-allocate. | |
| ~MemPool () | |
| Destructor. | |
| void * | alloc () |
| Allocate a new element. | |
| void | free (void *b) |
| Free an element. | |
| unsigned int | numChunks () const |
| Return number of allocated chunks. | |
Protected Attributes | |
| const unsigned int | esize |
| Size of elements in a chunk. | |
| const unsigned int | n |
| Number of elements per chunk. | |
| const unsigned int | csize |
| Size of memory chunks. | |
| Chunk * | chunks |
| Pointer to memory chunks. | |
| Link * | head |
| Pointer to first free link. | |
| unsigned int | num_chunks |
| Number of allocated chunks. | |
Private Member Functions | |
| MemPool (const MemPool &) | |
| Private to prohibit copying. | |
| MemPool & | operator= (const MemPool &) |
| Private to prohibit copying. | |
| void | grow () |
| Allocate a new chunk. | |
Classes | |
| struct | Chunk |
| Represents a memory chunk. More... | |
| struct | Link |
| Represents a memory element. More... | |
Definition at line 40 of file Sacado_Fad_MemPool.hpp.
| Sacado::Fad::MemPool::MemPool | ( | unsigned int | elem_size, | |
| unsigned int | n_elem, | |||
| unsigned int | pre_alloc = 0 | |||
| ) | [inline] |
Constructor. elem_size is the size of elements, n_elem is the number of elements per chunk. pre_alloc is the number of chunks to pre-allocate.
Definition at line 35 of file Sacado_Fad_MemPoolImp.hpp.
| Sacado::Fad::MemPool::~MemPool | ( | ) | [inline] |
| Sacado::Fad::MemPool::MemPool | ( | const MemPool & | ) | [private] |
Private to prohibit copying.
| void * Sacado::Fad::MemPool::alloc | ( | ) | [inline] |
| void Sacado::Fad::MemPool::free | ( | void * | b | ) | [inline] |
| unsigned int Sacado::Fad::MemPool::numChunks | ( | ) | const [inline] |
| void Sacado::Fad::MemPool::grow | ( | ) | [inline, private] |
const unsigned int Sacado::Fad::MemPool::esize [protected] |
const unsigned int Sacado::Fad::MemPool::n [protected] |
const unsigned int Sacado::Fad::MemPool::csize [protected] |
Chunk* Sacado::Fad::MemPool::chunks [protected] |
Link* Sacado::Fad::MemPool::head [protected] |
unsigned int Sacado::Fad::MemPool::num_chunks [protected] |
1.4.7