This class maintains a count of the total number of allocated bytes.
Synopsis
Declared in <ball_countingallocator.h>
class CountingAllocator
: public bslma::Allocator
Description
The running byte count is initialized to 0 upon construction, is increased by the allocate method, and may be reset to 0 by the resetNumBytesTotal method. The deallocate method appropriately decrement the byte count. The precise definition of byte count is described in the "Byte Count" section of the component‐level documentation.
Base Classes
Name |
Description |
Pure abstract protocol for clients and suppliers of raw memory. |
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 a counting allocator having an initial byte count of 0. |
|
Destroy this counting allocator. |
Allocate a maximally aligned block of the specified |
|
Return the memory at the specified |
|
|
|
|
|
Return the byte count maintained by this counting allocator. |
|
Reset the byte count maintained by this counting allocator to 0. |
Static Member Functions
Name |
Description |
Throw |
Protected Member Functions
Name |
Description |
|
Return a newly allocated block of at least |
|
Return the memory block at |
|
Return whether this allocator can exchange memory with |
Created with MrDocs