[#BloombergLP-bslma-SequentialPool] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::SequentialPool :relfileprefix: ../../ :mrdocs: This class implements a memory pool that dispenses arbitrarily‐sized blocks of memory from an internal buffer or an optionally user‐supplied buffer. 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. By default, buffer growth is not capped. The `release` method releases all memory allocated through this pool, as does the destructor. Note, however, that individual allocated blocks of memory cannot be individually deallocated. == Synopsis Declared in `<bslma_sequentialpool.h>` [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[`~SequentialPool`] [.small]#[destructor]# | Destroy this object and release all memory currently allocated through this pool. | xref:BloombergLP/bslma/SequentialPool/allocate.adoc[`allocate`] | Return memory of the specified `size`. If `size` is 0, no memory is allocated and 0 is returned. The behavior is undefined unless `0 <= size`. | xref:BloombergLP/bslma/SequentialPool/allocateAndExpand-0c.adoc[`allocateAndExpand`] | `allocateAndExpand` overloads | xref:BloombergLP/bslma/SequentialPool/deleteObject.adoc[`deleteObject`] | Destroy the specified `object`. Note that this method is exactly the same as the `deleteObjectRaw` method since no deallocation is involved. This method exists purely for consistency across pools. | xref:BloombergLP/bslma/SequentialPool/deleteObjectRaw.adoc[`deleteObjectRaw`] | Destroy the specified `object`. Note that the memory is not deallocated because there is no `deallocate` method in a `bslma_sequentialpool`. | 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. | xref:BloombergLP/bslma/SequentialPool/reserveCapacity.adoc[`reserveCapacity`] | Reserve sufficient memory to satisfy allocation requests for at least the specified `numBytes` without replenishment (i.e., without internal allocation). The behavior is undefined unless `0 <= numBytes`. | 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`. Return the amount of memory available at `address` after the truncation. The behavior is undefined unless the call to this allocator that provided the `address` was performed with the `originalNumBytes` and `newNumBytes <= originalNumBytes`. Note that this function will not truncate the memory unless there have been no allocations since the allocation for `originalNumBytes`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#