libMesh::FastPoolAllocator< T > Class Template Reference

#include <pool_allocator.h>

List of all members.

Classes

struct  rebind

Public Member Functions

 FastPoolAllocator ()
 FastPoolAllocator (const FastPoolAllocator &o)
 FastPoolAllocator ()
 FastPoolAllocator (const FastPoolAllocator &o)

Static Public Member Functions

static bool release_memory ()
static bool purge_memory ()
static bool release_memory ()
static bool purge_memory ()

Detailed Description

template<typename T>
class libMesh::FastPoolAllocator< T >

An allocator which can be used in standard containers. Uses pool-based memory allocation to efficiently allocate many small objects. Note that object destruction returns memory to the pool rather than deallocate it. It must be explicitly deallocated prior to program termination.

An allocator which can be used in standard containers. A wrapper for std::allocator<> when Boost is not available.

Definition at line 94 of file pool_allocator.h.


Constructor & Destructor Documentation

template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator (  )  [inline]

Definition at line 107 of file pool_allocator.h.

00107                         :
00108       boost::fast_pool_allocator<T>()
00109     {}

template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator ( const FastPoolAllocator< T > &  o  )  [inline, explicit]

Definition at line 111 of file pool_allocator.h.

00111                                                            :
00112       boost::fast_pool_allocator<T>(o)
00113     {}

template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator (  )  [inline]

Definition at line 195 of file pool_allocator.h.

00195                         :
00196       std::allocator<T>()
00197     {}

template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator ( const FastPoolAllocator< T > &  o  )  [inline, explicit]

Definition at line 199 of file pool_allocator.h.

00199                                                            :
00200       std::allocator<T>(o)
00201     {}


Member Function Documentation

template<typename T >
static bool libMesh::FastPoolAllocator< T >::purge_memory (  )  [inline, static]

Frees every memory block. This function invalidates any pointers previously returned by allocation functions. Returns true if at least one memory block was freed.

Definition at line 213 of file pool_allocator.h.

00213 { /* no-op for std::allocator<> - already freed. */ return false; }

template<typename T >
static bool libMesh::FastPoolAllocator< T >::purge_memory (  )  [inline, static]

Frees every memory block. This function invalidates any pointers previously returned by allocation functions. Returns true if at least one memory block was freed.

Definition at line 129 of file pool_allocator.h.

00130     {
00131       return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::purge_memory();
00132     }

template<typename T >
static bool libMesh::FastPoolAllocator< T >::release_memory (  )  [inline, static]

Frees every memory block that doesn't have any allocated chunks. Returns true if at least one memory block was freed.

Definition at line 207 of file pool_allocator.h.

00207 { /* no-op for std::allocator<> - already freed. */ return false; }

template<typename T >
static bool libMesh::FastPoolAllocator< T >::release_memory (  )  [inline, static]

Frees every memory block that doesn't have any allocated chunks. Returns true if at least one memory block was freed.

Definition at line 120 of file pool_allocator.h.

00121     {
00122       return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::release_memory();
00123     }


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

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:34 UTC

Hosted By:
SourceForge.net Logo