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

Thread&hyphen;safe pool of a fixed number of uniformly sized memory blocks&period;

== Synopsis

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

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

== Description

This class implements a memory pool that allocates and manages up to a fixed number of memory blocks of some uniform size, with both the limit on the number of blocks and the block size specified at construction&period;

This class guarantees thread safety when allocating or releasing memory (but see the documentation for the `release` method)&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlma/ConcurrentFixedPool/2constructor.adoc[`ConcurrentFixedPool`]         [.small]#[constructor]#
| Create a fixed&hyphen;size pool of uniformly sized memory blocks&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/2destructor.adoc[`&#126;ConcurrentFixedPool`] [.small]#[destructor]#
| Destroy this object and release all associated memory&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/addressFromIndex.adoc[`addressFromIndex`] 
| Return the address of the memory block identified by the specified `index`&period; The behavior is undefined unless the index has been obtained through `indexFromAddress`&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/allocate.adoc[`allocate`] 
| Allocate a memory block of the configured object size&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/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/ConcurrentFixedPool/backoffLevel.adoc[`backoffLevel`] 
| Return the non&hyphen;negative `backoffLevel` that controls the amount of spinning that occurs when calls to this pool encounter contention&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/deallocate.adoc[`deallocate`] 
| Deallocate the memory block at the specified `address` back to this pool for reuse&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/deleteObject.adoc[`deleteObject`] 
| Destroy and deallocate `object` using its dynamic type&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/deleteObjectRaw.adoc[`deleteObjectRaw`] 
| Destroy and deallocate `object` using its static type&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/indexFromAddress.adoc[`indexFromAddress`] 
| Return the index of the memory block at the specified `address`&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/objectSize.adoc[`objectSize`] 
| Return the size of the memory blocks allocated from this object&period; Note that all blocks have the same size&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/poolSize.adoc[`poolSize`] 
| Return the maximum size of this pool&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/release.adoc[`release`] 
| Release all memory currently allocated through this pool&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/reserveCapacity.adoc[`reserveCapacity`] 
| Reserve capacity for at least `numObjects` blocks from this pool&period;
| xref:BloombergLP/bdlma/ConcurrentFixedPool/setBackoffLevel.adoc[`setBackoffLevel`] 
| Configure the spin backoff level used under contention&period;
|===



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