This struct is a mechanism with global state, i.e., all state is held in global variables and all functions are class methods. The state consists of two distinct parts that don't influence one another: the default allocator and the global allocator. All addresses are stored without assuming ownership.
Synopsis
Declared in <bslma_default.h>
class Default;
Description
The setDefaultAllocator method will only modify the default allocator prior to the default allocator being accessed (by either allocator, defaultAllocator, or lockDefaultAllocator). The global allocator may be freely modified.
Note that only the owner of main (or in testing), where the caller affirmatively takes responsibility for the behavior of all clients of the global allocator, is intended to change the global allocator.
Static Member Functions
Name |
Description |
Return the allocator returned by |
|
Return the address of the default allocator and disable all subsequent calls to the |
|
Return the address of the global allocator if the optionally‐ specified |
|
Disable all subsequent calls to the |
|
Set the address of the default allocator to the specified |
|
Unconditionally set the address of the default allocator to the specified |
|
Unconditionally set the address of the global allocator to the specified |
Created with MrDocs