[#BloombergLP-ball-CountingAllocator-allocate-09] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/CountingAllocator.adoc[CountingAllocator]::allocate :relfileprefix: ../../../ :mrdocs: Allocate a maximally aligned block of the specified `size`. == Synopsis Declared in `<ball_countingallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- virtual void* allocate(xref:BloombergLP/bslma/Allocator/size_type.adoc[size_type] size) override; ---- == Description Return a newly allocated block of memory of (at least) the specified positive `size` (bytes) and increment the byte count maintained by this counting allocator by the sum of the least multiple of `bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT` that is greater than or equal to `size` and `bsls::AlignmentUtil::BSLS_MAX_ALIGNMENT`. The behavior is undefined unless `0 <= size`. Note that the alignment of the address returned is the maximum alignment for any fundamental type defined for the calling platform, even if the supplied allocator guarantees only natural alignment. [.small]#Created with https://www.mrdocs.com[MrDocs]#