Thread‐safe allocator that manages pooled memory blocks of uniform size.
Synopsis
Declared in <bdlma_concurrentpoolallocator.h>
class ConcurrentPoolAllocator
: public bslma::Allocator
Description
This class implements the bslma::Allocator protocol to provide an allocator that manages pooled memory blocks of some uniform size, specified either at construction, or at the first invocation of the allocate method. This allocator 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.
This class guarantees thread‐safety while allocating or releasing memory.
Base Classes
Name |
Description |
Pure abstract protocol for clients and suppliers of raw memory. |
Type Aliases
Name |
Description |
This |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this pool allocator. |
Return a newly allocated block of memory of (at least) |
|
Return the size (in bytes) of the memory blocks allocated from this allocator. Note that all blocks dispensed by this allocator have the same size. |
|
Return the memory at the specified |
|
|
|
|
|
Relinquish all memory currently allocated through this pool allocator. |
|
Reserve capacity for at least |
Static Member Functions
Name |
Description |
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of at least |
|
Return the memory block at |
|
Return whether this allocator can exchange memory with |
Created with MrDocs