[#BloombergLP-bslma-BufferAllocator-2constructor-0fb]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/BufferAllocator.adoc[BufferAllocator]::BufferAllocator
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;bslma&lowbar;bufferallocator&period;h&gt;`

Create a buffer allocator that allocates from the specified `buffer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/BufferAllocator/2constructor-0fc.adoc[BufferAllocator](
    char* buffer,
    xref:BloombergLP/bslma/Allocator/size_type.adoc[size&lowbar;type] bufSize,
    xref:BloombergLP/bslma/BufferAllocator/AllocCallback.adoc[AllocCallback] allocCallback = 0);
----

[.small]#xref:BloombergLP/bslma/BufferAllocator/2constructor-0fc.adoc[_» more&period;&period;&period;_]#

Create a buffer allocator that allocates from the specified `buffer` using the specified alignment `strategy`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslma/BufferAllocator/2constructor-06.adoc[BufferAllocator](
    char* buffer,
    xref:BloombergLP/bslma/Allocator/size_type.adoc[size&lowbar;type] bufSize,
    xref:BloombergLP/bslma/BufferAllocator/AlignmentStrategy.adoc[AlignmentStrategy] strategy,
    xref:BloombergLP/bslma/BufferAllocator/AllocCallback.adoc[AllocCallback] allocCallback = 0);
----

[.small]#xref:BloombergLP/bslma/BufferAllocator/2constructor-06.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buffer*
| Memory buffer from which to allocate&period;
| *bufSize*
| Size (in bytes) of `buffer`&period;
| *allocCallback*
| Optional callback invoked when allocation fails&period;
| *strategy*
| Alignment strategy used for allocations&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
