[#BloombergLP-bdlma-ConcurrentMultipool] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::ConcurrentMultipool :relfileprefix: ../../ :mrdocs: 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. == Synopsis Declared in `<bdlma_concurrentmultipool.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class ConcurrentMultipool; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlma/ConcurrentMultipool/2constructor-055.adoc[`ConcurrentMultipool`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlma/ConcurrentMultipool/2destructor.adoc[`~ConcurrentMultipool`] [.small]#[destructor]# | Destroy this multipool. All memory allocated from this memory pool is released. | xref:BloombergLP/bdlma/ConcurrentMultipool/allocate.adoc[`allocate`] | Return the address of a contiguous block of maximally‐aligned memory of (at least) the specified `size` (in bytes). If `size > maxPooledBlockSize()`, the memory allocation is managed directly by the underlying allocator, and will not be pooled, but will be deallocated when the `release` method is called, or when this object is destroyed. If `size` is 0, no memory is allocated and 0 is returned. | xref:BloombergLP/bdlma/ConcurrentMultipool/allocator.adoc[`allocator`] | 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. | xref:BloombergLP/bdlma/ConcurrentMultipool/deallocate.adoc[`deallocate`] | Relinquish the memory block at the specified `address` back to this multipool object for reuse. The behavior is undefined unless `address` is non‐zero, was allocated by this multipool object, and has not already been deallocated. | xref:BloombergLP/bdlma/ConcurrentMultipool/deleteObject.adoc[`deleteObject`] | Destroy the specified `object` based on its dynamic type and then use this multipool object to deallocate its memory footprint. This method has no effect if `object` is 0. The behavior is undefined unless `object`, when cast appropriately to `void *`, was allocated using this multipool object and has not already been deallocated. Note that `dynamic_cast<void *>(object)` is applied if `TYPE` is polymorphic, and `static_cast<void *>(object)` is applied otherwise. | xref:BloombergLP/bdlma/ConcurrentMultipool/deleteObjectRaw.adoc[`deleteObjectRaw`] | Destroy the specified `object` and then use this multipool to deallocate its memory footprint. This method has no effect if `object` is 0. The behavior is undefined unless `object` is *not* a secondary base class pointer (i.e., the address is (numerically) the same as when it was originally dispensed by this multipool), was allocated using this multipool, and has not already been deallocated. | xref:BloombergLP/bdlma/ConcurrentMultipool/maxPooledBlockSize.adoc[`maxPooledBlockSize`] | 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 `numPools` is either specified at construction, or an implementation‐defined value. | xref:BloombergLP/bdlma/ConcurrentMultipool/numPools.adoc[`numPools`] | Return the number of pools managed by this multipool object. | xref:BloombergLP/bdlma/ConcurrentMultipool/release.adoc[`release`] | Relinquish all memory currently allocated via this multipool object. | xref:BloombergLP/bdlma/ConcurrentMultipool/reserveCapacity.adoc[`reserveCapacity`] | Reserve memory from this multipool to satisfy memory requests for at least the specified `numBlocks` having the specified `size` (in bytes) before the pool replenishes. If `size` is 0, this method has no effect. The behavior is undefined unless `size <= maxPooledBlockSize()` and `0 <= numBlocks`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#