[#BloombergLP-bslma-TestAllocator-2constructor-097]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::xref:BloombergLP/bslma/TestAllocator.adoc[TestAllocator]::TestAllocator
:relfileprefix: ../../../
:mrdocs:

Create an instrumented &quot;test&quot; allocator&period;

== Synopsis

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

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

== Description

Create an instrumented &quot;test&quot; allocator&period; Optionally specify a `name` (associated with this object) to be included in diagnostic messages written to `stdout`, thereby distinguishing this test allocator from others that might be used in the same program&period; If `name` is 0 (or not specified), no distinguishing name is incorporated in diagnostics&period; Optionally specify a `verboseFlag` indicating whether this test allocator should automatically report all allocation&sol;deallocation events to `stdout` and print accumulated statistics on destruction&period; If `verboseFlag` is `false` (or not specified), allocation&sol;deallocation and summary messages will not be written automatically&period; Optionally specify a `basicAllocator` used to supply memory&period; If `basicAllocator` is 0, the `MallocFreeAllocator` singleton is used&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *basicAllocator*
| The allocator used to supply memory&period;
|===


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