[#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 "test" allocator. == Synopsis Declared in `<bslma_testallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit TestAllocator(xref:BloombergLP/bslma/Allocator.adoc[Allocator]* basicAllocator = 0); ---- == Description Create an instrumented "test" allocator. 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. If `name` is 0 (or not specified), no distinguishing name is incorporated in diagnostics. Optionally specify a `verboseFlag` indicating whether this test allocator should automatically report all allocation/deallocation events to `stdout` and print accumulated statistics on destruction. If `verboseFlag` is `false` (or not specified), allocation/deallocation and summary messages will not be written automatically. Optionally specify a `basicAllocator` used to supply memory. If `basicAllocator` is 0, the `MallocFreeAllocator` singleton is used. == Parameters [cols="1,4"] |=== | Name| Description | *basicAllocator* | The allocator used to supply memory. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#