Open3D (C++ API)  0.18.0+3975044
Data Structures | Public Types | Public Member Functions | Static Public Member Functions
open3d::core::MemoryManagerStatistic Class Reference

#include <MemoryManagerStatistic.h>

Public Types

enum class  PrintLevel { All = 0 , Unbalanced = 1 , None = 2 }
 

Public Member Functions

 MemoryManagerStatistic (const MemoryManagerStatistic &)=delete
 
MemoryManagerStatisticoperator= (MemoryManagerStatistic &)=delete
 
 ~MemoryManagerStatistic ()
 
void SetPrintLevel (PrintLevel level)
 Sets the level of provided information for printing. More...
 
void SetPrintAtProgramEnd (bool print)
 
void SetPrintAtMallocFree (bool print)
 Enables or disables printing at each malloc and free. More...
 
void Print () const
 Prints statistics for all recorded devices depending on the print level. More...
 
bool HasLeaks () const
 
void CountMalloc (void *ptr, size_t byte_size, const Device &device)
 Adds the given allocation to the statistics. More...
 
void CountFree (void *ptr, const Device &device)
 
void Reset ()
 Resets the statistics. More...
 

Static Public Member Functions

static MemoryManagerStatisticGetInstance ()
 

Member Enumeration Documentation

◆ PrintLevel

Enumerator
All 

Statistics for all used devices are printed.

Unbalanced 

Only devices with unbalanced counts are printed. This is typically an indicator for memory leaks.

None 

No statistics are printed.

Constructor & Destructor Documentation

◆ MemoryManagerStatistic()

open3d::core::MemoryManagerStatistic::MemoryManagerStatistic ( const MemoryManagerStatistic )
delete

◆ ~MemoryManagerStatistic()

open3d::core::MemoryManagerStatistic::~MemoryManagerStatistic ( )

Member Function Documentation

◆ CountFree()

void open3d::core::MemoryManagerStatistic::CountFree ( void *  ptr,
const Device device 
)

Adds the given deallocations to the statistics. Counts for previously recorded allocations after a reset are ignored for consistency.

◆ CountMalloc()

void open3d::core::MemoryManagerStatistic::CountMalloc ( void *  ptr,
size_t  byte_size,
const Device device 
)

Adds the given allocation to the statistics.

◆ GetInstance()

MemoryManagerStatistic & open3d::core::MemoryManagerStatistic::GetInstance ( )
static

◆ HasLeaks()

bool open3d::core::MemoryManagerStatistic::HasLeaks ( ) const

Returns true if any recorded device has unbalanced counts, false otherwise.

◆ operator=()

MemoryManagerStatistic& open3d::core::MemoryManagerStatistic::operator= ( MemoryManagerStatistic )
delete

◆ Print()

void open3d::core::MemoryManagerStatistic::Print ( ) const

Prints statistics for all recorded devices depending on the print level.

◆ Reset()

void open3d::core::MemoryManagerStatistic::Reset ( )

Resets the statistics.

◆ SetPrintAtMallocFree()

void open3d::core::MemoryManagerStatistic::SetPrintAtMallocFree ( bool  print)

Enables or disables printing at each malloc and free.

◆ SetPrintAtProgramEnd()

void open3d::core::MemoryManagerStatistic::SetPrintAtProgramEnd ( bool  print)

Enables or disables printing at the program end. Printing at the program end additionally overrides the exit code to EXIT_FAILURE in the presence of leaks.

◆ SetPrintLevel()

void open3d::core::MemoryManagerStatistic::SetPrintLevel ( PrintLevel  level)

Sets the level of provided information for printing.


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