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
Name |
Description |
|
Create a fixed‐size pool of uniformly sized memory blocks. |
|
Destroy this object and release all associated memory. |
Return the address of the memory block identified by the specified |
|
Allocate a memory block of the configured object size. |
|
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. |
|
Return the non‐negative |
|
Deallocate the memory block at the specified |
|
Destroy and deallocate |
|
Destroy and deallocate |
|
Return the index of the memory block at the specified |
|
Return the size of the memory blocks allocated from this object. Note that all blocks have the same size. |
|
Return the maximum size of this pool. |
|
Release all memory currently allocated through this pool. |
|
Reserve capacity for at least |
|
Configure the spin backoff level used under contention. |
Created with MrDocs