An STL node allocator that uses a segment manager as memory source. More...
#include <interprocess_fwd.hpp>
Classes | |
struct | rebind |
Public Types | |
typedef ipcdetail::cached_allocator_impl < T, ipcdetail::shared_adaptive_node_pool < SegmentManager, sizeof_value < T >::value, NodesPerBlock, MaxFreeBlocks, OverheadPercent >, 2 > | base_t |
typedef boost::interprocess::version_type < cached_adaptive_pool, 2 > | version |
Public Member Functions | |
cached_adaptive_pool (SegmentManager *segment_mngr, std::size_t max_cached_nodes=base_t::DEFAULT_MAX_CACHED_NODES) | |
template<class T2 > | |
cached_adaptive_pool (const cached_adaptive_pool< T2, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent > &other) | |
An STL node allocator that uses a segment manager as memory source.
The internal pointer type will of the same type (raw, smart) as "typename SegmentManager::void_pointer" type. This allows placing the allocator in shared memory, memory mapped-files, etc...
This node allocator shares a segregated storage between all instances of cached_adaptive_pool with equal sizeof(T) placed in the same memory segment. But also caches some nodes privately to avoid some synchronization overhead.
NodesPerBlock is the minimum number of nodes of nodes allocated at once when the allocator needs runs out of nodes. MaxFreeBlocks is the maximum number of totally free blocks that the adaptive node pool will hold. The rest of the totally free blocks will be deallocated with the segment manager.
OverheadPercent is the (approximated) maximum size overhead (1-20%) of the allocator: (memory usable for nodes / total memory allocated from the segment manager)
typedef ipcdetail::cached_allocator_impl< T , ipcdetail::shared_adaptive_node_pool < SegmentManager , sizeof_value<T>::value , NodesPerBlock , MaxFreeBlocks , OverheadPercent > , 2> boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >::base_t |
typedef boost::interprocess::version_type<cached_adaptive_pool, 2> boost::interprocess::cached_adaptive_pool< T, SegmentManager, NodesPerBlock, MaxFreeBlocks, OverheadPercent >::version |
|
inline |
|
inline |