Constructors

Synopses

Declared in <bslma_bufferallocator.h>

Create a buffer allocator that allocates from the specified buffer.

BufferAllocator(
    char* buffer,
    size_type bufSize,
    AllocCallback allocCallback = 0);

Create a buffer allocator that allocates from the specified buffer using the specified alignment strategy.

BufferAllocator(
    char* buffer,
    size_type bufSize,
    AlignmentStrategy strategy,
    AllocCallback allocCallback = 0);

Parameters

Name

Description

buffer

Memory buffer from which to allocate.

bufSize

Size (in bytes) of buffer.

allocCallback

Optional callback invoked when allocation fails.

strategy

Alignment strategy used for allocations.

Created with MrDocs