Sacado::Fad::MemPool Class Reference

Memory pool. More...

#include <Sacado_Fad_MemPool.hpp>

Collaboration diagram for Sacado::Fad::MemPool:

Collaboration graph
[legend]
List of all members.

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.
Chunkchunks
 Pointer to memory chunks.
Linkhead
 Pointer to first free link.
unsigned int num_chunks
 Number of allocated chunks.

Classes

struct  Chunk
 Represents a memory chunk. More...
struct  Link
 Represents a memory element. More...

Detailed Description

Memory pool.


The documentation for this class was generated from the following files:
Generated on Wed May 12 21:39:26 2010 for Sacado by  doxygen 1.4.7