mitteLib
Loading...
Searching...
No Matches
mlab::mem_counter Class Reference

#include <tracker_allocator.hpp>

Public Member Functions

std::size_t current () const
 
std::size_t peak () const
 
 mem_counter ()
 
void update_peak (std::size_t new_current)
 
mem_counteroperator++ ()
 
mem_counteroperator-- ()
 
mem_counteroperator+= (std::size_t bytes)
 
mem_counteroperator-= (std::size_t bytes)
 

Static Public Member Functions

static std::string format_mem (std::size_t bytes)
 

Private Attributes

std::atomic< std::size_t > _current
 
std::atomic< std::size_t > _peak
 

Constructor & Destructor Documentation

◆ mem_counter()

mlab::mem_counter::mem_counter ( )

Member Function Documentation

◆ current()

std::size_t mlab::mem_counter::current ( ) const
nodiscard

◆ format_mem()

std::string mlab::mem_counter::format_mem ( std::size_t bytes)
staticnodiscard

◆ operator++()

mem_counter & mlab::mem_counter::operator++ ( )

◆ operator+=()

mem_counter & mlab::mem_counter::operator+= ( std::size_t bytes)

◆ operator--()

mem_counter & mlab::mem_counter::operator-- ( )

◆ operator-=()

mem_counter & mlab::mem_counter::operator-= ( std::size_t bytes)

◆ peak()

std::size_t mlab::mem_counter::peak ( ) const
nodiscard

◆ update_peak()

void mlab::mem_counter::update_peak ( std::size_t new_current)

Member Data Documentation

◆ _current

std::atomic<std::size_t> mlab::mem_counter::_current
private

◆ _peak

std::atomic<std::size_t> mlab::mem_counter::_peak
private

The documentation for this class was generated from the following files: