Strategies

Strategies are used in Umpire to allow custom algorithms to be applied when allocating memory. These strategies can do anything, from providing different pooling methods to speed up allocations to applying different operations to every alloctaion. Strategies can be composed to combine their functionality, allowing flexible and reusable implementations of different components.

class AllocationStrategy

AllocationStrategy provides a unified interface to all classes that can be used to allocate and free data.

Subclassed by umpire::resource::MemoryResource, umpire::strategy::AllocationAdvisor, umpire::strategy::AllocationPrefetcher, umpire::strategy::AllocationTracker, umpire::strategy::DynamicPoolList, umpire::strategy::DynamicPoolMap, umpire::strategy::FixedPool, umpire::strategy::MixedPool, umpire::strategy::MonotonicAllocationStrategy, umpire::strategy::NamedAllocationStrategy, umpire::strategy::NumaPolicy, umpire::strategy::QuickPool, umpire::strategy::SizeLimiter, umpire::strategy::SlotPool, umpire::strategy::ThreadSafeAllocator, umpire::strategy::ZeroByteHandler

Provided Strategies

class AllocationAdvisor : public umpire::strategy::AllocationStrategy

Applies the given MemoryOperation to every allocation.

This AllocationStrategy is designed to be used with the following operations:

Using this AllocationStrategy when combined with a pool like DynamicPool is a good way to mitigate the overhead of applying the memory advice.

Warning

doxygenclass: Cannot find class “umpire::strategy::DynamicPool” in doxygen xml output for project “umpire” from directory: ../doxygen/xml/

class FixedPool : public umpire::strategy::AllocationStrategy

Pool for fixed size allocations.

This AllocationStrategy provides an efficient pool for fixed size allocations, and used to quickly allocate and deallocate objects.

class MonotonicAllocationStrategy : public umpire::strategy::AllocationStrategy
class SlotPool : public umpire::strategy::AllocationStrategy
class ThreadSafeAllocator : public umpire::strategy::AllocationStrategy

Make an Allocator thread safe.

Using this AllocationStrategy will make the provided allocator thread-safe by syncronizing access to the allocators interface.