[#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 == (address & (alignment ‐ 1))`. If `size` is 0, a null pointer is returned with no other effect. If the requested number of appropriately aligned bytes cannot be returned, then a `bsl::bad_alloc` exception is thrown, or in a non‐exception build the program is terminated. The behavior is undefined unless `alignment` is both a multiple of `sizeof(void *)` and an integral non‐negative power of two. == Synopsis Declared in `<bdlma_alignedallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- virtual void* allocateAligned( xref:BloombergLP/bsls/Types/size_type.adoc[bsls::Types::size_type] size, xref:BloombergLP/bsls/Types/size_type.adoc[bsls::Types::size_type] alignment) = 0; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#