UMPIRE
Umpire: resource management and provision
DynamicSizePool< IA > Class Template Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/strategy/DynamicSizePool.hpp>

Inheritance diagram for DynamicSizePool< IA >:

Classes

struct  Block
 

Public Member Functions

 DynamicSizePool (umpire::strategy::AllocationStrategy *strat, const std::size_t first_minimum_pool_allocation_size=(16 *1024), const std::size_t next_minimum_pool_allocation_size=256, const std::size_t alignment=16)
 
 DynamicSizePool (const DynamicSizePool &)=delete
 
 ~DynamicSizePool ()
 
void * allocate (std::size_t bytes)
 
void deallocate (void *ptr)
 
void release ()
 
std::size_t getReleasableBlocks () const noexcept
 
std::size_t getTotalBlocks () const noexcept
 
std::size_t getActualSize () const
 
std::size_t getActualHighwaterMark () const noexcept
 
std::size_t getAlignedSize () const noexcept
 
std::size_t getAlignedHighwaterMark () const noexcept
 
std::size_t getBlocksInPool () const
 
std::size_t getLargestAvailableBlock () const
 
std::size_t getReleasableSize () const
 
std::size_t getFreeBlocks () const
 
std::size_t getInUseBlocks () const
 
void coalesce (std::size_t suggested_size)
 

Protected Types

typedef FixedSizePool< struct Block, IA, IA,(1<< 6)> BlockPool
 

Protected Member Functions

void findUsableBlock (struct Block *&best, struct Block *&prev, std::size_t size)
 
void allocateBlock (struct Block *&curr, struct Block *&prev, std::size_t size)
 
void splitBlock (struct Block *&curr, struct Block *&prev, const std::size_t size)
 
void releaseBlock (struct Block *curr, struct Block *prev)
 
std::size_t freeReleasedBlocks ()
 
void coalesceFreeBlocks (std::size_t size)
 

Protected Attributes

BlockPool blockPool {}
 
struct BlockusedBlocks {nullptr}
 
struct BlockfreeBlocks {nullptr}
 
std::size_t m_aligned_bytes {0}
 
std::size_t m_aligned_highwatermark {0}
 
std::size_t m_actual_bytes {0}
 
std::size_t m_actual_highwatermark {0}
 
std::size_t m_first_minimum_pool_allocation_size
 
std::size_t m_next_minimum_pool_allocation_size
 
std::size_t m_releasable_blocks {0}
 
std::size_t m_total_blocks {0}
 
bool m_is_destructing {false}
 

Member Typedef Documentation

◆ BlockPool

template<class IA = StdAllocator>
typedef FixedSizePool<struct Block, IA, IA, (1 << 6)> DynamicSizePool< IA >::BlockPool
protected

Constructor & Destructor Documentation

◆ DynamicSizePool() [1/2]

template<class IA = StdAllocator>
DynamicSizePool< IA >::DynamicSizePool ( umpire::strategy::AllocationStrategy strat,
const std::size_t  first_minimum_pool_allocation_size = (16 * 1024),
const std::size_t  next_minimum_pool_allocation_size = 256,
const std::size_t  alignment = 16 
)
inline

◆ DynamicSizePool() [2/2]

template<class IA = StdAllocator>
DynamicSizePool< IA >::DynamicSizePool ( const DynamicSizePool< IA > &  )
delete

◆ ~DynamicSizePool()

Member Function Documentation

◆ findUsableBlock()

template<class IA = StdAllocator>
void DynamicSizePool< IA >::findUsableBlock ( struct Block *&  best,
struct Block *&  prev,
std::size_t  size 
)
inlineprotected

◆ allocateBlock()

◆ splitBlock()

◆ releaseBlock()

◆ freeReleasedBlocks()

◆ coalesceFreeBlocks()

◆ allocate()

◆ deallocate()

◆ release()

template<class IA = StdAllocator>
void DynamicSizePool< IA >::release ( )
inline

◆ getReleasableBlocks()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getReleasableBlocks ( ) const
inlinenoexcept

◆ getTotalBlocks()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getTotalBlocks ( ) const
inlinenoexcept

◆ getActualSize()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getActualSize ( ) const
inline

◆ getActualHighwaterMark()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getActualHighwaterMark ( ) const
inlinenoexcept

◆ getAlignedSize()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getAlignedSize ( ) const
inlinenoexcept

◆ getAlignedHighwaterMark()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getAlignedHighwaterMark ( ) const
inlinenoexcept

◆ getBlocksInPool()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getBlocksInPool ( ) const
inline

◆ getLargestAvailableBlock()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getLargestAvailableBlock ( ) const
inline

◆ getReleasableSize()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getReleasableSize ( ) const
inline

◆ getFreeBlocks()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getFreeBlocks ( ) const
inline

◆ getInUseBlocks()

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::getInUseBlocks ( ) const
inline

◆ coalesce()

Member Data Documentation

◆ blockPool

◆ usedBlocks

◆ freeBlocks

◆ m_aligned_bytes

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_aligned_bytes {0}
protected

◆ m_aligned_highwatermark

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_aligned_highwatermark {0}
protected

◆ m_actual_bytes

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_actual_bytes {0}
protected

◆ m_actual_highwatermark

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_actual_highwatermark {0}
protected

◆ m_first_minimum_pool_allocation_size

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_first_minimum_pool_allocation_size
protected

◆ m_next_minimum_pool_allocation_size

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_next_minimum_pool_allocation_size
protected

◆ m_releasable_blocks

◆ m_total_blocks

template<class IA = StdAllocator>
std::size_t DynamicSizePool< IA >::m_total_blocks {0}
protected

◆ m_is_destructing

template<class IA = StdAllocator>
bool DynamicSizePool< IA >::m_is_destructing {false}
protected