[#BloombergLP-bdlma-Pool] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::Pool :relfileprefix: ../../ :mrdocs: This class implements a memory pool that allocates and manages memory blocks of some uniform size specified at construction. == Synopsis Declared in `<bdlma_pool.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class Pool; ---- == Description This memory pool maintains an internal linked list of free memory blocks, and dispenses one block for each `allocate` method invocation. When a memory block is deallocated, it is returned to the free list for potential reuse. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlma/Pool/2constructor-08.adoc[`Pool`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlma/Pool/2destructor.adoc[`~Pool`] [.small]#[destructor]# | Destroy this pool, releasing all associated memory back to the underlying allocator. | xref:BloombergLP/bdlma/Pool/allocate.adoc[`allocate`] | Return the address of a contiguous block of maximally‐aligned memory having the fixed block size specified at construction. | xref:BloombergLP/bdlma/Pool/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/Pool/blockSize.adoc[`blockSize`] | Return the size (in bytes) of the memory blocks allocated from this pool object. Note that all blocks dispensed by this pool have the same size. | xref:BloombergLP/bdlma/Pool/deallocate.adoc[`deallocate`] | Relinquish the memory block at the specified `address` back to this pool for reuse. | xref:BloombergLP/bdlma/Pool/deleteObject.adoc[`deleteObject`] | Destroy and deallocate `object` using its dynamic type. | xref:BloombergLP/bdlma/Pool/deleteObjectRaw.adoc[`deleteObjectRaw`] | Destroy and deallocate `object` using its static type. | xref:BloombergLP/bdlma/Pool/release.adoc[`release`] | Relinquish all memory currently allocated via this pool object. | xref:BloombergLP/bdlma/Pool/reserveCapacity.adoc[`reserveCapacity`] | Reserve capacity for at least `numBlocks` blocks from this pool. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#