Thrill  0.1
Manager Class Reference

Detailed Description

Object shared by allocators and other classes to track memory allocations.

These is one global mem::Manager per compute host. To track memory consumption of subcomponents of Thrill, one can create local child mem::Managers which report allocation automatically to their superiors.

Definition at line 28 of file manager.hpp.

+ Collaboration diagram for Manager:

#include <manager.hpp>

Public Member Functions

 Manager (Manager *super, const char *name)
 
 ~Manager ()
 
Manageradd (size_t amount)
 add memory consumption. More...
 
Managersubtract (size_t amount)
 subtract memory consumption. More...
 
Managersuper ()
 return the superior Manager More...
 
size_t total () const
 return total allocation (local value) More...
 

Private Attributes

std::atomic< size_t > alloc_count_ { 0 }
 number of allocation More...
 
const char * name_
 description for output More...
 
std::atomic< size_t > peak_ { 0 }
 peak allocation More...
 
Managersuper_
 reference to superior memory counter More...
 
std::atomic< size_t > total_ { 0 }
 total allocation More...
 

Static Private Attributes

static constexpr bool debug = false
 

Constructor & Destructor Documentation

◆ Manager()

Manager ( Manager super,
const char *  name 
)
inlineexplicit

Definition at line 33 of file manager.hpp.

References Manager::~Manager().

◆ ~Manager()

Member Function Documentation

◆ add()

Manager& add ( size_t  amount)
inline

add memory consumption.

Definition at line 46 of file manager.hpp.

References Manager::add(), Manager::alloc_count_, max(), Manager::peak_, Manager::super_, and Manager::total_.

Referenced by Manager::add(), and Allocator< char >::allocate().

◆ subtract()

Manager& subtract ( size_t  amount)
inline

subtract memory consumption.

Definition at line 55 of file manager.hpp.

References Manager::subtract(), Manager::super_, and Manager::total_.

Referenced by Allocator< char >::deallocate(), and Manager::subtract().

◆ super()

Manager* super ( )
inline

return the superior Manager

Definition at line 40 of file manager.hpp.

References Manager::super_.

◆ total()

size_t total ( ) const
inline

return total allocation (local value)

Definition at line 43 of file manager.hpp.

References Manager::total_.

Referenced by Allocator< char >::allocate(), and Allocator< char >::deallocate().

Member Data Documentation

◆ alloc_count_

std::atomic<size_t> alloc_count_ { 0 }
private

number of allocation

Definition at line 76 of file manager.hpp.

Referenced by Manager::add(), and Manager::~Manager().

◆ debug

constexpr bool debug = false
staticprivate

Definition at line 30 of file manager.hpp.

Referenced by Manager::~Manager().

◆ name_

const char* name_
private

description for output

Definition at line 67 of file manager.hpp.

Referenced by Manager::~Manager().

◆ peak_

std::atomic<size_t> peak_ { 0 }
private

peak allocation

Definition at line 73 of file manager.hpp.

Referenced by Manager::add(), and Manager::~Manager().

◆ super_

Manager* super_
private

reference to superior memory counter

Definition at line 64 of file manager.hpp.

Referenced by Manager::add(), Manager::subtract(), and Manager::super().

◆ total_

std::atomic<size_t> total_ { 0 }
private

total allocation

Definition at line 70 of file manager.hpp.

Referenced by Manager::add(), Manager::subtract(), Manager::total(), and Manager::~Manager().


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