Reserve enough memory to satisfy at least numBytes of allocations without replenishment.

Synopsis

Declared in <bdlma_sequentialallocator.h>

void
reserveCapacity(bsls::Types::size_type numBytes);

Description

Reserve sufficient memory to satisfy allocation requests for at least the specified numBytes without replenishment (i.e., without dynamic allocation). If numBytes is 0, no memory is reserved. Note that, when the numBytes is distributed over multiple allocate requests ‐ due to alignment effects ‐ it is possible that not all numBytes of memory will be used for allocation before triggering dynamic allocation.

Parameters

Name

Description

numBytes

minimum number of bytes to reserve

Created with MrDocs