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

Expand the allocation at `address` to include the remaining buffer&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bsls/Types/size_type.adoc[bsls::Types::size&lowbar;type]
expand(
    void* address,
    xref:BloombergLP/bsls/Types/size_type.adoc[bsls::Types::size&lowbar;type] size);
----

== Description

Increase the amount of memory allocated at the specified `address` from the original `size` (in bytes) to also include the maximum amount remaining in the buffer&period; Return the amount of memory available at `address` after expanding, or `size` if the memory at `address` cannot be expanded&period; This method can only `expand` the memory block returned by the most recent `allocate` or `allocateRaw` request from this buffer manager, and otherwise has no effect&period; The behavior is undefined unless the memory at `address` was originally allocated by this buffer manager, the size of the memory at `address` is `size`, and `release` was not called after allocating the memory at `address`&period;

== Return Value

amount of memory available at `address` after expanding, or `size` if the memory at `address` cannot be expanded

== Parameters

[cols="1,4"]
|===
| Name| Description
| *address*
| memory previously allocated by this buffer manager
| *size*
| current size in bytes of the allocation at `address`
|===


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