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

Truncate the allocation at `address` from `originalSize` to `newSize`&period;

== Synopsis

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

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

== Description

Reduce the amount of memory allocated at the specified `address` of the specified `originalSize` (in bytes) to the specified `newSize`&period; Return `newSize` after truncating, or `originalSize` if the memory block at `address` cannot be truncated&period; This method can only `truncate` the memory block returned by the most recent `allocate` request from this memory pool, and otherwise has no effect&period; The behavior is undefined unless the memory block at `address` was originally allocated by this memory pool, the size of the memory block at `address` is `originalSize`, `newSize &lt;&equals; originalSize`, and `release` was not called after allocating the memory block at `address`&period;

== Return Value

`newSize` after truncating, or `originalSize` if the memory block at `address` cannot be truncated

== Parameters

[cols="1,4"]
|===
| Name| Description
| *address*
| memory previously allocated by this pool
| *originalSize*
| current size in bytes of the allocation at `address`
| *newSize*
| desired size in bytes after truncation
|===


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