BloombergLP::bslma::BufferAllocator::allocateFromBuffer

allocateFromBuffer overloads

Synopses

Declared in <bslma_bufferallocator.h>

Allocate a memory block of the specified size from buffer.

static
void*
allocateFromBuffer(
    int* cursor,
    char* buffer,
    size_type bufSize,
    size_type size,
    AlignmentStrategy strategy);
» more...

Allocate a memory block of the specified size from buffer with the specified alignment.

static
void*
allocateFromBuffer(
    int* cursor,
    char* buffer,
    size_type bufSize,
    size_type size,
    int alignment);
» more...

Return Value

address of the allocated block, or null if insufficient space

Parameters

NameDescription
cursorIndex of the next available byte in buffer (in/out).
bufferMemory buffer from which to allocate.
bufSizeSize (in bytes) of buffer.
sizeNumber of bytes to allocate.
strategyAlignment strategy used for the allocation.
alignmentAlignment (in bytes) for the allocated block.