BloombergLP::bslma::TestAllocator::TestAllocator

Create an instrumented "test" allocator.

Synopsis

Declared in <bslma_testallocator.h>

explicit
TestAllocator(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

NameDescription
basicAllocatorThe allocator used to supply memory.