BloombergLP::bslma::SequentialAllocator::expand

Expand the memory block at the specified address.

Synopsis

Declared in <bslma_sequentialallocator.h>

int
expand(
    void* address,
    int originalNumBytes);

Description

Increase the amount of memory allocated at the specified address from the specified originalNumBytes to the maximum amount easily obtainable. Return the amount of memory available at address after the expansion. The behavior is undefined unless the call to this allocator that provided the address was performed with the originalNumBytes. Note that this function will not expand the memory unless there have been no allocations since the allocation for originalNumBytes.

Return Value

The amount of memory available after expansion (in bytes).

Parameters

NameDescription
addressThe address of the memory block to expand.
originalNumBytesThe original allocation size (in bytes).