BloombergLP::bdlma::SequentialPool::SequentialPool

Create a sequential pool, optionally deferring the initial buffer allocation.

Synopsis

Declared in <bdlma_sequentialpool.h>

SequentialPool(
    bsls::Types::size_type initialSize,
    bsls::Types::size_type maxBufferSize,
    bsls::BlockGrowth::Strategy growthStrategy,
    bsls::Alignment::Strategy alignmentStrategy,
    bool allocateInitialBuffer,
    bslma::Allocator* basicAllocator = 0);

Description

Create a sequential pool for allocating memory blocks from a sequence of dynamically-allocated buffers, of which the initial buffer has the specified initialSize (in bytes), the internal buffer growth is limited to the specified maxBufferSize, the specified growthStrategy is used to control buffer growth, and the specified alignmentStrategy is used to control alignment of allocated memory blocks. Allocate the initial buffer only if the specified allocateInitialBuffer is true. Optionally specify a basicAllocator used to supply memory for the dynamically-allocated buffers. If basicAllocator is 0, the currently installed default allocator is used. The behavior is undefined unless 0 < initialSize and initialSize <= maxBufferSize. Note that when constant growth is used, the size of the internal buffers will always be the same as initialSize.

Parameters

NameDescription
initialSizeinitial size in bytes of the internal buffer
maxBufferSizemaximum dynamically allocated buffer size in bytes
growthStrategystrategy controlling growth of internal buffers
alignmentStrategystrategy used to align allocated memory blocks
allocateInitialBuffertrue to allocate the initial buffer now
basicAllocatormemory allocator; null uses the default