This class provides direct access to the system‐supplied (native) global std::malloc and std::free. A static method is provided for obtaining a unique, process wide object of this class, which is valid from the time the method is called until after the program (not just main) exits.
Synopsis
Declared in <bslma_mallocfreeallocator.h>
class MallocFreeAllocator
: public Allocator
Base Classes
Name |
Description |
This protocol class provides a pure abstract interface and contract for clients and suppliers of raw memory. If the requested memory cannot be returned, the contract requires that an |
Type Aliases
Name |
Description |
Alias for an unsigned integral type capable of representing the number of bytes in this platform's virtual address space. |
Member Functions
Name |
Description |
|
Create an allocator that uses |
|
Destroy this allocator. Note that the behavior of destroying an allocator while memory is allocated from it is not specified. (Unless you know that it is valid to do so, don't!) |
Return a newly allocated block of memory of (at least) the specified positive |
|
Return the memory block at the specified |
|
|
|
|
|
Static Member Functions
Name |
Description |
Return a reference to a valid object of this class. Note that this object is guaranteed to be valid from the time of this call onward (i.e., not just until exiting |
|
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of memory of (at least) the specified positive |
|
Return the memory block at the specified |
|
Return |
Created with MrDocs