[#BloombergLP-bslma-AllocatorUtil-allocateBytes]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/AllocatorUtil.adoc[AllocatorUtil]::allocateBytes
:relfileprefix: ../../../
:mrdocs:

Return a pointer to a block of raw memory allocated from the specified `allocator` having the specified `nbytes` size and optionally specified `alignment`&period; If `alignment` is not specified, the natural alignment for an object of size `nbytes` is used&period; If `alignment` is larger than the largest supported alignment for `t&lowbar;ALLOCATOR`, either the block will be aligned to the maximum supported alignment or an exception will be thrown&semi; the specific choice of behavior is determined by the allocator&period; For polymorphic allocators the behavior of extended alignment is determined by the memory resource, whereas for non&hyphen;polymorphic allocators, the alignment is always truncated to the maximum non&hyphen;extended alignment&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ALLOCATOR&gt;
static
AllocatorUtil&lowbar;Traits&lt;t&lowbar;ALLOCATOR&gt;::void&lowbar;pointer
allocateBytes(
    t&lowbar;ALLOCATOR const& allocator,
    std::size&lowbar;t nbytes,
    std::size&lowbar;t alignment = 0);
----


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