[#BloombergLP-bslma-NewDeleteAllocator-allocator]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/NewDeleteAllocator.adoc[NewDeleteAllocator]::allocator
:relfileprefix: ../../../
:mrdocs:

Return `basicAllocator`, or this class&apos;s singleton if it is 0&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
xref:BloombergLP/bslma/Allocator.adoc[Allocator]*
allocator(xref:BloombergLP/bslma/Allocator.adoc[Allocator]* basicAllocator);
----

== Description

Return the address of the specified modifiable `basicAllocator` or, if `basicAllocator` is 0, the process&hyphen;wide unique (see `singleton`) object of this class&period; Note that the behavior of this function is equivalent to the following expression&colon; &grave; basicAllocator ? basicAllocator &colon; &amp;NewDeleteAllocator&colon;&colon;singleton() &grave; Also note that if a `NewDeleteAllocator` object is supplied, it is owned by the class and must NOT be deleted&period; Finally note that this method should generally not be called directly by typical clients (see `bslma&lowbar;default` for more information)&period;

== Return Value

`basicAllocator`, or this class&apos;s singleton if it is 0

== Parameters

[cols="1,4"]
|===
| Name| Description
| *basicAllocator*
| allocator to return, or 0 for the singleton
|===


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