[#BloombergLP-bslma-SequentialPool]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::SequentialPool
:relfileprefix: ../../
:mrdocs:

This class implements a memory pool that dispenses arbitrarily&hyphen;sized blocks of memory from an internal buffer or an optionally user&hyphen;supplied buffer&period; If an allocation request exceeds the remaining free memory space in the current buffer, the pool either replenishes its buffer with new memory to satisfy the request, or returns a separate memory block, depending on whether the request size exceeds an optionally specified maximum buffer size&period; By default, buffer growth is not capped&period; The `release` method releases all memory allocated through this pool, as does the destructor&period; Note, however, that individual allocated blocks of memory cannot be individually deallocated&period;

== Synopsis

Declared in `&lt;bslma&lowbar;sequentialpool&period;h&gt;`

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/SequentialPool/2constructor-0e90.adoc[`SequentialPool`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bslma/SequentialPool/2destructor.adoc[`&#126;SequentialPool`] [.small]#[destructor]#
| Destroy this object and release all memory currently allocated through this pool&period;
| xref:BloombergLP/bslma/SequentialPool/allocate.adoc[`allocate`] 
| Return memory of the specified `size`&period; If `size` is 0, no memory is allocated and 0 is returned&period; The behavior is undefined unless `0 &lt;&equals; size`&period;
| xref:BloombergLP/bslma/SequentialPool/allocateAndExpand-0c.adoc[`allocateAndExpand`] 
| `allocateAndExpand` overloads
| xref:BloombergLP/bslma/SequentialPool/deleteObject.adoc[`deleteObject`] 
| Destroy the specified `object`&period; Note that this method is exactly the same as the `deleteObjectRaw` method since no deallocation is involved&period; This method exists purely for consistency across pools&period;
| xref:BloombergLP/bslma/SequentialPool/deleteObjectRaw.adoc[`deleteObjectRaw`] 
| Destroy the specified `object`&period; Note that the memory is not deallocated because there is no `deallocate` method in a `bslma&lowbar;sequentialpool`&period;
| xref:BloombergLP/bslma/SequentialPool/expand-04.adoc[`expand`] 
| `expand` overloads
| xref:BloombergLP/bslma/SequentialPool/release.adoc[`release`] 
| Release all memory currently allocated through this pool&period;
| xref:BloombergLP/bslma/SequentialPool/reserveCapacity.adoc[`reserveCapacity`] 
| Reserve sufficient memory to satisfy allocation requests for at least the specified `numBytes` without replenishment (i&period;e&period;, without internal allocation)&period; The behavior is undefined unless `0 &lt;&equals; numBytes`&period;
| xref:BloombergLP/bslma/SequentialPool/truncate.adoc[`truncate`] 
| Reduce the amount of memory allocated at the specified `address` from the specified `originalNumBytes` to the specified `newNumBytes`&period; Return the amount of memory available at `address` after the truncation&period; The behavior is undefined unless the call to this allocator that provided the `address` was performed with the `originalNumBytes` and `newNumBytes &lt;&equals; originalNumBytes`&period; Note that this function will not truncate the memory unless there have been no allocations since the allocation for `originalNumBytes`&period;
|===



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