This class implements a memory pool that allocates and manages memory blocks of some uniform size specified at construction. This memory pool maintains an internal linked list of free memory blocks, and dispenses one block for each allocate method invocation. When a memory block is deallocated, it is returned to the free list for potential reuse.
Synopsis
Declared in <bdlma_concurrentpool.h>
class ConcurrentPool;
Description
This class guarantees thread safety while allocating or releasing memory.
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this pool, releasing all associated memory back to the underlying allocator. |
Return the address of a contiguous block of memory having the fixed block size specified at construction. |
|
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 size (in bytes) of the memory blocks allocated from this pool object. Note that all blocks dispensed by this pool have the same size. |
|
Relinquish the memory block at the specified |
|
Destroy the specified |
|
Destroy the specified |
|
Relinquish all memory currently allocated via this pool object. |
|
Reserve memory from this pool to satisfy memory requests for at least the specified |
Created with MrDocs