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);

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);

Return Value

address of the allocated block, or null if insufficient space

Parameters

Name

Description

cursor

Index of the next available byte in buffer (in/out).

buffer

Memory buffer from which to allocate.

bufSize

Size (in bytes) of buffer.

size

Number of bytes to allocate.

strategy

Alignment strategy used for the allocation.

alignment

Alignment (in bytes) for the allocated block.

Created with MrDocs