[#BloombergLP-bslma-SequentialAllocator-truncate] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/SequentialAllocator.adoc[SequentialAllocator]::truncate :relfileprefix: ../../../ :mrdocs: Reduce the amount of memory allocated at the specified `address`. == Synopsis Declared in `<bslma_sequentialallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int truncate( void* address, int originalNumBytes, int newNumBytes); ---- == Description Reduce the amount of memory allocated at the specified `address` from the specified `originalNumBytes` to the specified `newNumBytes`. Return the amount of memory available at `address` after the truncation. The behavior is undefined unless the call to this allocator that provided the `address` was performed with the `originalNumBytes` and `newNumBytes <= originalNumBytes`. Note that this function will not truncate the memory unless there have been no allocations since the allocation for `originalNumBytes`. == Return Value The amount of memory available after truncation (in bytes). == Parameters [cols="1,4"] |=== | Name| Description | *address* | The address of the memory block to truncate. | *originalNumBytes* | The original allocation size (in bytes). | *newNumBytes* | The truncated allocation size (in bytes). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#