Template Class DynamicSizePool

Nested Relationships

Inheritance Relationships

Base Type

Class Documentation

template<class IA = StdAllocator>
class DynamicSizePool : private umpire::strategy::mixins::AlignedAllocation

Public 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 getActualSize() const
std::size_t getCurrentSize() const
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()

Protected Types

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

Protected 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 Block *usedBlocks
struct Block *freeBlocks
std::size_t m_actual_bytes
std::size_t m_current_size = {0}
std::size_t m_first_minimum_pool_allocation_size
std::size_t m_next_minimum_pool_allocation_size
bool m_is_destructing = {false}

Private Functions

std::size_t aligned_round_up(std::size_t size)

Round up the size to be an integral multple of configured alignment.

Return

Size rounded up to be integral multiple of configured alignment

void *aligned_allocate(const std::size_t size)

Return an allocation of size bytes that is aligned on the configured alignment boundary.

void aligned_deallocate(void *ptr)

Deallocate previously alligned allocation.

Private Members

strategy::AllocationStrategy *m_allocator
struct Block

Public Members

char *data
std::size_t size
std::size_t blockSize
Block *next