Unconditionally set the address of the global allocator to the specified basicAllocator, or to the address of the NewDeleteAllocator singleton if basicAllocator is 0. Return the address of the global allocator in effect immediately before calling this method. The behavior is undefined unless basicAllocator is 0 or is the address of an allocator with sufficient lifetime to satisfy all global allocation requests within this process, and unless there is only one thread started within this process. Note that prior to the first call to this method, the address of the global allocator is that of the NewDeleteAllocator singleton. Also note that this method is intended for use only by the owner of main (or for use in testing) where the caller affirmatively takes responsibility for the behavior of all clients of the global allocator, and should not be used for any other purpose.

Synopsis

Declared in <bslma_default.h>

static
Allocator*
setGlobalAllocator(Allocator* basicAllocator);

Created with MrDocs