[#BloombergLP-bdlma-ConcurrentMultipool]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::ConcurrentMultipool
:relfileprefix: ../../
:mrdocs:

Thread&hyphen;safe multipool that manages memory via size&hyphen;tiered pools&period;

== Synopsis

Declared in `&lt;bdlma&lowbar;concurrentmultipool&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class ConcurrentMultipool;
----

== Description

This class implements a memory manager that maintains a configurable number of `bdlma&colon;&colon;Pool` objects, each dispensing memory blocks of a unique size&period; The `Pool` objects are placed in an array, with each successive pool managing memory blocks of size twice that of the previous pool&period; 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&period; Both the `release` method and the destructor of a `bdema&colon;&colon;Multipool` release all memory currently allocated via the object&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlma/ConcurrentMultipool/2constructor-055.adoc[`ConcurrentMultipool`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlma/ConcurrentMultipool/2destructor.adoc[`&#126;ConcurrentMultipool`] [.small]#[destructor]#
| Destroy this multipool&period; All memory allocated from this memory pool is released&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/allocate.adoc[`allocate`] 
| Return a contiguous block of maximally&hyphen;aligned memory of at least `size`&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/allocator.adoc[`allocator`] 
| Return the allocator used by this object to allocate memory&period; Note that this allocator can not be used to deallocate memory allocated through this pool&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/deallocate.adoc[`deallocate`] 
| Relinquish the memory block at `address` back to this multipool&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/deleteObject.adoc[`deleteObject`] 
| Destroy and deallocate `object` using its dynamic type&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/deleteObjectRaw.adoc[`deleteObjectRaw`] 
| Destroy and deallocate `object` using its static type&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/maxPooledBlockSize.adoc[`maxPooledBlockSize`] 
| Return the maximum size of memory blocks pooled by this multipool&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/numPools.adoc[`numPools`] 
| Return the number of pools managed by this multipool object&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/release.adoc[`release`] 
| Relinquish all memory currently allocated via this multipool object&period;
| xref:BloombergLP/bdlma/ConcurrentMultipool/reserveCapacity.adoc[`reserveCapacity`] 
| Reserve capacity for at least `numBlocks` blocks of the specified `size`&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
