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

Name

Description

buffer

external buffer from which to allocate

bufferSize

size in bytes of buffer

strategy

alignment strategy for allocated memory blocks

Created with MrDocs