[#BloombergLP-bdlma-AlignedAllocator-allocateAligned]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::xref:BloombergLP/bdlma/AlignedAllocator.adoc[AlignedAllocator]::allocateAligned
:relfileprefix: ../../../
:mrdocs:

Return the address of a newly allocated block of memory of at least the specified positive `size` (in bytes), sufficiently aligned such that the returned `address` satisfies, for the specified `alignment`, `0 &equals;&equals; (address &amp; (alignment &hyphen; 1))`&period; If `size` is 0, a null pointer is returned with no other effect&period; If the requested number of appropriately aligned bytes cannot be returned, then a `bsl&colon;&colon;bad&lowbar;alloc` exception is thrown, or in a non&hyphen;exception build the program is terminated&period; The behavior is undefined unless `alignment` is both a multiple of `sizeof(void &ast;)` and an integral non&hyphen;negative power of two&period;

== Synopsis

Declared in `&lt;bdlma&lowbar;alignedallocator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void*
allocateAligned(
    xref:BloombergLP/bsls/Types/size_type.adoc[bsls::Types::size&lowbar;type] size,
    xref:BloombergLP/bsls/Types/size_type.adoc[bsls::Types::size&lowbar;type] alignment) = 0;
----


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