32 #ifndef SACADO_FAD_MEMPOOL_HPP
33 #define SACADO_FAD_MEMPOOL_HPP
49 MemPool(
unsigned int elem_size,
unsigned int n_elem,
50 unsigned int pre_alloc = 0);
115 #endif // SACADO_FAD_MEMPOOL_HPP
const unsigned int csize
Size of memory chunks.
unsigned int num_chunks
Number of allocated chunks.
void free(void *b)
Free an element.
void grow()
Allocate a new chunk.
unsigned int numChunks() const
Return number of allocated chunks.
Represents a memory element.
Chunk * chunks
Pointer to memory chunks.
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...
Represents a memory chunk.
Link * head
Pointer to first free link.
const unsigned int n
Number of elements per chunk.
void * alloc()
Allocate a new element.
MemPool & operator=(const MemPool &)
Private to prohibit copying.
const unsigned int esize
Size of elements in a chunk.