[#BloombergLP-bslma-TestAllocator-allocate-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/TestAllocator.adoc[TestAllocator]::allocate
:relfileprefix: ../../../
:mrdocs:

Return a newly&hyphen;allocated block of memory of the specified `size`&period;

== Synopses

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

Return a newly&hyphen;allocated block of memory of the specified `size`&period;


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

[.small]#xref:BloombergLP/bslma/TestAllocator/allocate-04.adoc[_» more&period;&period;&period;_]#


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lsqb;&lsqb;nodiscard&rsqb;&rsqb;
void*
xref:BloombergLP/bslma/Allocator/allocate-034.adoc[allocate](
    size&lowbar;t &lowbar;&lowbar;bytes,
    size&lowbar;t &lowbar;&lowbar;alignment = &lowbar;S&lowbar;max&lowbar;align);
----

[.small]#xref:BloombergLP/bslma/Allocator/allocate-034.adoc[_» more&period;&period;&period;_]#

== Return Value

newly&hyphen;allocated block of `size` bytes, or null if `size` is 0

== Parameters

[cols="1,4"]
|===
| Name| Description
| *size*
| Number of bytes to allocate&period;
|===


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