Thread‐safe multipool that manages memory via size‐tiered pools.
Synopsis
Declared in <bdlma_concurrentmultipool.h>
class ConcurrentMultipool;
Description
This class implements a memory manager that maintains a configurable number of bdlma::Pool objects, each dispensing memory blocks of a unique size. The Pool objects are placed in an array, with each successive pool managing memory blocks of size twice that of the previous pool. Each multipool allocation (deallocation) request allocates memory from (returns memory to) the internal pool having the smallest block size not less than the requested size, or, if no pool manages memory blocks of sufficient sized, from a separately managed list of memory blocks. Both the release method and the destructor of a bdema::Multipool release all memory currently allocated via the object.
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this multipool. All memory allocated from this memory pool is released. |
Return a contiguous block of maximally‐aligned memory of at least |
|
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. |
|
Relinquish the memory block at |
|
Destroy and deallocate |
|
Destroy and deallocate |
|
Return the maximum size of memory blocks pooled by this multipool. |
|
Return the number of pools managed by this multipool object. |
|
Relinquish all memory currently allocated via this multipool object. |
|
Reserve capacity for at least |
Created with MrDocs