[#BloombergLP-bslma-BufferAllocator-allocateFromBuffer-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/BufferAllocator.adoc[BufferAllocator]::allocateFromBuffer :relfileprefix: ../../../ :mrdocs: `allocateFromBuffer` overloads == Synopses Declared in `<bslma_bufferallocator.h>` Allocate a memory block of the specified `size` from `buffer`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void* xref:BloombergLP/bslma/BufferAllocator/allocateFromBuffer-06.adoc[allocateFromBuffer]( int* cursor, char* buffer, xref:BloombergLP/bslma/Allocator/size_type.adoc[size_type] bufSize, xref:BloombergLP/bslma/Allocator/size_type.adoc[size_type] size, xref:BloombergLP/bslma/BufferAllocator/AlignmentStrategy.adoc[AlignmentStrategy] strategy); ---- [.small]#xref:BloombergLP/bslma/BufferAllocator/allocateFromBuffer-06.adoc[_» more..._]# Allocate a memory block of the specified `size` from `buffer` with the specified `alignment`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void* xref:BloombergLP/bslma/BufferAllocator/allocateFromBuffer-03.adoc[allocateFromBuffer]( int* cursor, char* buffer, xref:BloombergLP/bslma/Allocator/size_type.adoc[size_type] bufSize, xref:BloombergLP/bslma/Allocator/size_type.adoc[size_type] size, int alignment); ---- [.small]#xref:BloombergLP/bslma/BufferAllocator/allocateFromBuffer-03.adoc[_» more..._]# == Return Value address of the allocated block, or null if insufficient space == Parameters [cols="1,4"] |=== | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#