[#BloombergLP-bdlma-CountingAllocator-allocate-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlma.adoc[bdlma]::xref:BloombergLP/bdlma/CountingAllocator.adoc[CountingAllocator]::allocate
:relfileprefix: ../../../
:mrdocs:

Return a newly&hyphen;allocated block of memory of the specified `size` (in bytes)&period; If `size` is 0, a null pointer is returned with no other effect (e&period;g&period;, on allocation statistics)&period; Otherwise, invoke the `allocate` method of the allocator supplied at construction, and increment the number of currently (and cumulatively) allocated bytes by `size`&period;

== Synopsis

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

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


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