libMesh::FastPoolAllocator< T > Class Template Reference

#include <pool_allocator.h>

Inheritance diagram for libMesh::FastPoolAllocator< T >:

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 97 of file pool_allocator.h.

Constructor & Destructor Documentation

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

Definition at line 110 of file pool_allocator.h.

110  :
111  boost::fast_pool_allocator<T>()
112  {}
template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator ( const FastPoolAllocator< T > &  o)
inlineexplicit

Definition at line 114 of file pool_allocator.h.

114  :
115  boost::fast_pool_allocator<T>(o)
116  {}
template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator ( )
inline

Definition at line 198 of file pool_allocator.h.

198  :
199  std::allocator<T>()
200  {}
template<typename T >
libMesh::FastPoolAllocator< T >::FastPoolAllocator ( const FastPoolAllocator< T > &  o)
inlineexplicit

Definition at line 202 of file pool_allocator.h.

202  :
203  std::allocator<T>(o)
204  {}

Member Function Documentation

template<typename T >
static bool libMesh::FastPoolAllocator< T >::purge_memory ( )
inlinestatic

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 132 of file pool_allocator.h.

133  {
134  return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::purge_memory();
135  }
template<typename T >
static bool libMesh::FastPoolAllocator< T >::purge_memory ( )
inlinestatic

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 216 of file pool_allocator.h.

216 { /* no-op for std::allocator<> - already freed. */ return false; }
template<typename T >
static bool libMesh::FastPoolAllocator< T >::release_memory ( )
inlinestatic

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

Definition at line 123 of file pool_allocator.h.

124  {
125  return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::release_memory();
126  }
template<typename T >
static bool libMesh::FastPoolAllocator< T >::release_memory ( )
inlinestatic

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

Definition at line 210 of file pool_allocator.h.

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

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

Site Created By: libMesh Developers
Last modified: February 07 2014 16:58:01 UTC

Hosted By:
SourceForge.net Logo