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

This class implements a low&hyphen;level memory manager that allocates and manages a sequence of memory blocks &hyphen;&hyphen; each potentially of a different size as specified during the invocation of the `allocate` method&period; Allocated blocks may be efficiently deallocated individually, i&period;e&period;, potentially in constant time depending on the supplied allocator&period; The `release` method deallocates the entire sequence of memory blocks, as does the destructor&period;

== Synopsis

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

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

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlma/BlockList/2constructor.adoc[`BlockList`]         [.small]#[constructor]#
| Create an empty block list suitable for managing memory blocks of varying sizes&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the currently installed default allocator is used&period;
| xref:BloombergLP/bdlma/BlockList/2destructor.adoc[`&#126;BlockList`] [.small]#[destructor]#
| Destroy this object and deallocate all outstanding memory blocks managed by this object&period;
| xref:BloombergLP/bdlma/BlockList/allocate.adoc[`allocate`] 
| Return the address of a contiguous block of memory of the specified `size` (in bytes)&period; If `size` is 0, no memory is allocated and 0 is returned&period; The returned memory is guaranteed to be maximally aligned&period;
| xref:BloombergLP/bdlma/BlockList/allocator.adoc[`allocator`] 
| Return the allocator used by this object to allocate memory&period;
| xref:BloombergLP/bdlma/BlockList/deallocate.adoc[`deallocate`] 
| Return the memory at the specified `address` back to the associated allocator&period; If `address` is 0, this function has no effect&period; The behavior is undefined unless `address` was allocated by this object, and has not already been deallocated&period;
| xref:BloombergLP/bdlma/BlockList/release.adoc[`release`] 
| Deallocate all memory blocks currently managed by this object, returning it to its default&hyphen;constructed state&period;
|===



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