Truncate the allocation at address from originalSize to newSize.
Declared in <bdlma_buffermanager.h>
bsls::Types::size_type
truncate(
void* address,
bsls::Types::size_type originalSize,
bsls::Types::size_type newSize);
Reduce the amount of memory allocated at the specified address of the specified originalSize (in bytes) to the specified newSize (in bytes). Return newSize after truncating, or originalSize if the memory at address cannot be truncated. 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. 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 <= originalSize, 0 <= newSize, and release was not called after allocating the memory at address.
newSize after truncating, or originalSize if the memory at address cannot be truncated
| Name | Description |
|---|---|
| address | memory previously allocated by this buffer manager |
| originalSize | current size in bytes of the allocation at address |
| newSize | desired size in bytes after truncation |