BloombergLP::bdlma::ConcurrentFixedPool

Thread-safe pool of a fixed number of uniformly sized memory blocks.

Synopsis

Declared in <bdlma_concurrentfixedpool.h>

class ConcurrentFixedPool;

Description

This class implements a memory pool that allocates and manages up to a fixed number of memory blocks of some uniform size, with both the limit on the number of blocks and the block size specified at construction.

This class guarantees thread safety when allocating or releasing memory (but see the documentation for the release method).

Member Functions

NameDescription
ConcurrentFixedPool [constructor]Create a fixed-size pool of uniformly sized memory blocks.
~ConcurrentFixedPool [destructor]Destroy this object and release all associated memory.
addressFromIndex Return the address of the memory block identified by the specified index. The behavior is undefined unless the index has been obtained through indexFromAddress.
allocate Allocate a memory block of the configured object size.
allocator Return the allocator used by this object to allocate memory. Note that this allocator can not be used to deallocate memory allocated through this pool.
backoffLevel Return the non-negative backoffLevel that controls the amount of spinning that occurs when calls to this pool encounter contention.
deallocate Deallocate the memory block at the specified address back to this pool for reuse.
deleteObject Destroy and deallocate object using its dynamic type.
deleteObjectRaw Destroy and deallocate object using its static type.
indexFromAddress Return the index of the memory block at the specified address.
objectSize Return the size of the memory blocks allocated from this object. Note that all blocks have the same size.
poolSize Return the maximum size of this pool.
release Release all memory currently allocated through this pool.
reserveCapacity Reserve capacity for at least numObjects blocks from this pool.
setBackoffLevel Configure the spin backoff level used under contention.