[#BloombergLP-bsltf-StdTestAllocator-05-allocate]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsltf.adoc[bsltf]::xref:BloombergLP/bsltf/StdTestAllocator-05.adoc[StdTestAllocator]::allocate
:relfileprefix: ../../../
:mrdocs:

Allocate space for the specified `numElements` objects of type `TYPE`&period;

== Synopsis

Declared in `&lt;bsltf&lowbar;stdtestallocator&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bsltf/StdTestAllocator-05/pointer.adoc[StdTestAllocator&lt;TYPE&gt;::pointer]
allocate(xref:BloombergLP/bsltf/StdTestAllocator-05/size_type.adoc[size&lowbar;type] numElements);
----

== Description

Allocate enough (properly aligned) space for the specified `numElements` of type `T`&period; If the configured delegate allocator is unable to fulfill the allocation request, an exception (typically `bsl&colon;&colon;bad&lowbar;alloc`) will be thrown&period; The behavior is undefined unless `numElements &lt;&equals; max&lowbar;size()`&period;

== Return Value

a pointer to the allocated space for `numElements` objects

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numElements*
| number of `TYPE` objects for which to allocate space
|===


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