BloombergLP::bdlma::BufferManager::BufferManager

Create a buffer manager that allocates from the specified external buffer.

Synopsis

Declared in <bdlma_buffermanager.h>

BufferManager(
    char* buffer,
    bsls::Types::size_type bufferSize,
    bsls::Alignment::Strategy strategy = bsls::Alignment::BSLS_NATURAL);

Description

Create a buffer manager for allocating memory blocks from the specified external buffer having the specified bufferSize (in bytes). Optionally specify an alignment strategy used to align allocated memory blocks. If strategy is not specified, natural alignment is used. The behavior is undefined unless 0 < bufferSize and buffer has at least bufferSize bytes.

Parameters

NameDescription
bufferexternal buffer from which to allocate
bufferSizesize in bytes of buffer
strategyalignment strategy for allocated memory blocks