18 #ifndef LIBMESH_POOL_ALLOCATOR_H 19 #define LIBMESH_POOL_ALLOCATOR_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>()
71 boost::pool_allocator<T>(o)
80 return boost::singleton_pool<boost::pool_allocator_tag, sizeof(T)>::release_memory();
91 return boost::singleton_pool<boost::pool_allocator_tag, sizeof(T)>::purge_memory();
110 template <
typename T>
125 boost::fast_pool_allocator<T>()
129 boost::fast_pool_allocator<T>(o)
139 return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::release_memory();
150 return boost::singleton_pool<boost::fast_pool_allocator_tag, sizeof(T)>::purge_memory();
165 template <
typename T>
166 class PoolAllocator :
public std::allocator<T>
211 template <
typename T>
212 class FastPoolAllocator :
public std::allocator<T>
252 #endif // LIBMESH_POOL_ALLOCATOR_H FastPoolAllocator< U > other
Boost-derived allocator that can be used with std::containers.
PoolAllocator(const PoolAllocator &o)
static bool purge_memory()
static bool release_memory()
static bool release_memory()
FastPoolAllocator(const FastPoolAllocator &o)
Boost-derived allocator that can be used with std::containers.
static bool purge_memory()