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

Fast memory pool dispensing blocks from an external buffer&period;

== Synopsis

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

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

== Description

This class implements a fast memory pool that efficiently dispenses heterogeneous blocks of memory (of varying, user&hyphen;specified sizes) from an external buffer whose address and size (in bytes) are supplied at construction&period; If an allocation request exceeds the remaining free memory space in the external buffer, memory will be supplied by an (optional) allocator supplied also at construction&semi; if no allocator is supplied, the currently installed default allocator will be used&period; This class is _exception_ _neutral_&colon; If memory cannot be allocated, the behavior is defined by the (optional) allocator supplied at construction&period; Note that in no case will the buffered sequential pool attempt to deallocate the external buffer&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlma/BufferedSequentialPool/2constructor-0ad.adoc[`BufferedSequentialPool`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlma/BufferedSequentialPool/2destructor.adoc[`&#126;BufferedSequentialPool`] [.small]#[destructor]#
| Destroy this buffered sequential pool&period; All memory allocated from this pool is released&period;
| xref:BloombergLP/bdlma/BufferedSequentialPool/allocate.adoc[`allocate`] 
| Return a block of memory of the specified `size` (in bytes)&period;
| xref:BloombergLP/bdlma/BufferedSequentialPool/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/BufferedSequentialPool/deleteObject.adoc[`deleteObject`] 
| Destroy the specified `object`&period;
| xref:BloombergLP/bdlma/BufferedSequentialPool/deleteObjectRaw.adoc[`deleteObjectRaw`] 
| Destroy the specified `object`&period;
| xref:BloombergLP/bdlma/BufferedSequentialPool/release.adoc[`release`] 
| Release all memory allocated through this pool except the external buffer supplied at construction&period;
| xref:BloombergLP/bdlma/BufferedSequentialPool/rewind.adoc[`rewind`] 
| Release allocated memory while retaining this pool&apos;s typical internal buffers&period;
|===


== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlma/BufferedSequentialPool/d_allocator_p.adoc[`d&lowbar;allocator&lowbar;p`] [.small]#[variant member]#
| Allocator supplied at construction when the sequential pool has not yet been created&period;
| xref:BloombergLP/bdlma/BufferedSequentialPool/d_pool_p.adoc[`d&lowbar;pool&lowbar;p`] [.small]#[variant member]#
| Sequential pool used once the external buffer is exhausted&period;
|===



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