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

Reduce the amount of memory allocated at the specified `address` of the specified `originalSize` (in bytes) to the specified `newSize` (in bytes)&period; Return `newSize` after truncating, or `originalSize` if the memory at `address` cannot be truncated&period; This method can only `truncate` the memory block returned by the most recent `allocate` or `allocateRaw` request from this object, 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 `originalSize`, `newSize &lt;&equals; originalSize`, `0 &lt;&equals; newSize`, and `release` was not called after allocating the memory at `address`&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]
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);
----


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