18 #ifndef LIBMESH_POOL_ALLOCATOR_H 19 #define LIBMESH_POOL_ALLOCATOR_H 21 #include "libmesh/libmesh_config.h" 23 #ifdef LIBMESH_HAVE_BOOST 25 #define BOOST_POOL_NO_MT // disable multi-threading 26 #define BOOST_THREAD_MUTEX_HPP // define the #include-guard to disable the header 27 # include <boost/pool/pool.hpp> 28 # include <boost/pool/object_pool.hpp> 29 # include <boost/pool/pool_alloc.hpp> 37 #ifdef LIBMESH_HAVE_BOOST 67 boost::pool_allocator<T>()
72 boost::pool_allocator<T>(o)
81 return boost::singleton_pool<boost::pool_allocator_tag, sizeof(T)>::release_memory();
92 return boost::singleton_pool<boost::pool_allocator_tag, sizeof(T)>::purge_memory();
111 template <
typename T>
126 boost::fast_pool_allocator<T>()
129 template <
typename U>
131 boost::fast_pool_allocator<T>(o)
141 return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::release_memory();
152 return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::purge_memory();
167 template <
typename T>
168 class PoolAllocator :
public std::allocator<T>
184 template <
typename U>
214 template <
typename T>
215 class FastPoolAllocator :
public std::allocator<T>
231 template <
typename U>
256 #endif // LIBMESH_POOL_ALLOCATOR_H FastPoolAllocator< U > other
An allocator which can be used in standard containers.
static bool purge_memory()
Frees every memory block.
FastPoolAllocator(const FastPoolAllocator< U > &o)
The libMesh namespace provides an interface to certain functionality in the library.
static bool release_memory()
Frees every memory block that doesn't have any allocated chunks.
static bool release_memory()
Frees every memory block that doesn't have any allocated chunks.
Methods required for copy construction of containers using this allocator.
An allocator which can be used in standard containers.
PoolAllocator(const PoolAllocator< U > &o)
static bool purge_memory()
Frees every memory block.
Methods required for copy construction of containers using this allocator.