CookMem 1.4.0
A C++ memory context / allocator
Loading...
Searching...
No Matches
cookmem::MemStatistics Struct Reference

#include <logger.h>

Public Member Functions

std::size_t getNumAllocations () const
 
std::size_t getNumAllocations (MemAllocType_et allocType) const
 
std::size_t getNumDeallocations () const
 
std::size_t getNumGetSegments () const
 
std::size_t getNumFreeSegments () const
 
std::size_t getNumTrimEmptySegments () const
 
std::size_t getTotalAllocated () const
 
std::size_t getTotalDeallocated () const
 
std::size_t getTotalGetSegmentSize () const
 
std::size_t getTotalFreeSegmentSize () const
 
std::size_t getCurrentAllocated () const
 
std::size_t getPeakAllocated () const
 
std::size_t getCurrentSegments () const
 
std::size_t getPeakSegments () const
 
std::size_t getCurrentSegmentSize () const
 
std::size_t getPeakSegmentSize () const
 
void printStats () const
 

Static Public Member Functions

static const char * getAllocationTypeName (MemAllocType_et allocType)
 

Detailed Description

Memory allocation and segment usage statistics.

Member Function Documentation

◆ getAllocationTypeName()

static const char * cookmem::MemStatistics::getAllocationTypeName ( MemAllocType_et  allocType)
inlinestatic

Get a short name for an allocation type, as printed by printStats ().

Parameters
allocTypethe allocation type.
Returns
the name of the allocation type, or "unknown".

◆ getCurrentAllocated()

std::size_t cookmem::MemStatistics::getCurrentAllocated ( ) const
inline

Get the current number of allocated user bytes.

◆ getCurrentSegments()

std::size_t cookmem::MemStatistics::getCurrentSegments ( ) const
inline

Get the current number of active memory segments.

◆ getCurrentSegmentSize()

std::size_t cookmem::MemStatistics::getCurrentSegmentSize ( ) const
inline

Get the current size of active memory segments.

◆ getNumAllocations() [1/2]

std::size_t cookmem::MemStatistics::getNumAllocations ( ) const
inline

Get the number of successful allocation events.

◆ getNumAllocations() [2/2]

std::size_t cookmem::MemStatistics::getNumAllocations ( MemAllocType_et  allocType) const
inline

Get the number of successful allocations of a particular type.

◆ getNumDeallocations()

std::size_t cookmem::MemStatistics::getNumDeallocations ( ) const
inline

Get the number of deallocation events.

◆ getNumFreeSegments()

std::size_t cookmem::MemStatistics::getNumFreeSegments ( ) const
inline

Get the number of released memory segments.

◆ getNumGetSegments()

std::size_t cookmem::MemStatistics::getNumGetSegments ( ) const
inline

Get the number of acquired memory segments.

◆ getNumTrimEmptySegments()

std::size_t cookmem::MemStatistics::getNumTrimEmptySegments ( ) const
inline

Get the number of pool empty-segment trimming passes.

◆ getPeakAllocated()

std::size_t cookmem::MemStatistics::getPeakAllocated ( ) const
inline

Get the peak number of allocated user bytes.

◆ getPeakSegments()

std::size_t cookmem::MemStatistics::getPeakSegments ( ) const
inline

Get the peak number of active memory segments.

◆ getPeakSegmentSize()

std::size_t cookmem::MemStatistics::getPeakSegmentSize ( ) const
inline

Get the peak size of active memory segments.

◆ getTotalAllocated()

std::size_t cookmem::MemStatistics::getTotalAllocated ( ) const
inline

Get the total number of bytes allocated.

◆ getTotalDeallocated()

std::size_t cookmem::MemStatistics::getTotalDeallocated ( ) const
inline

Get the total number of bytes deallocated.

◆ getTotalFreeSegmentSize()

std::size_t cookmem::MemStatistics::getTotalFreeSegmentSize ( ) const
inline

Get the total size of released memory segments.

◆ getTotalGetSegmentSize()

std::size_t cookmem::MemStatistics::getTotalGetSegmentSize ( ) const
inline

Get the total size of acquired memory segments.

◆ printStats()

void cookmem::MemStatistics::printStats ( ) const
inline

Print the statistics to stdout.


The documentation for this struct was generated from the following file: