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.
Synopsis
Declared in <bdlma_concurrentpoolallocator.h>
class ConcurrentPoolAllocator
: public bslma::Allocator
Description
This class guarantees thread‐safety while allocating or releasing memory.
Base Classes
Name |
Description |
This protocol class provides a pure abstract interface and contract for clients and suppliers of raw memory. If the requested memory cannot be returned, the contract requires that an |
Type Aliases
Name |
Description |
This |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this pool allocator. |
Return a newly allocated block of memory of (at least) the specified positive |
|
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 memory from this pool allocator to satisfy memory requests for at least the specified |
Static Member Functions
Name |
Description |
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of memory of (at least) the specified positive |
|
Return the memory block at the specified |
|
Return |
Created with MrDocs