This class implements a memory manager that maintains a configurable number of bdlma::Pool objects, each dispensing memory blocks of a unique size. The bdlma::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 size, from a separately managed list of memory blocks. Both the release method and the destructor of a bdlma::Multipool release all memory currently allocated via the object.
Synopsis
Declared in <bdlma_multipool.h>
class Multipool;
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this multipool. All memory allocated from this memory pool is released. |
Return the address of a contiguous block of maximally‐aligned memory of (at least) the specified |
|
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 the specified |
|
Destroy the specified |
|
Destroy the specified |
|
Return the maximum size of memory blocks that are pooled by this multipool object. Note that the maximum value is defined as: ` 2 ˆ (numPools + 2) ` where |
|
Return the number of pools managed by this multipool object. |
|
Relinquish all memory currently allocated via this multipool object. |
|
Reserve memory from this multipool to satisfy memory requests for at least the specified |
Created with MrDocs