HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_MemLeakDetector.h File Reference
#include "UT_API.h"
#include "UT_NonCopyable.h"
#include <stdlib.h>
+ Include dependency graph for UT_MemLeakDetector.h:

Go to the source code of this file.

Classes

class  UT_MemLeakDetectorImpl::Block
 

Namespaces

 UT_MemLeakDetectorImpl
 

Macros

#define UT_MEMLEAK_CONCAT_IMPL(x, y)   x ## y
 
#define UT_MEMLEAK_CONCAT(x, y)   UT_MEMLEAK_CONCAT_IMPL(x, y)
 
#define UT_MEMLEAK_VAR(name)   UT_MEMLEAK_CONCAT(name, __COUNTER__)
 
#define UT_MEMBLOCK(...)
 
#define UT_MEMBLOCK_V(var,...)   UT_MemLeakDetectorImpl::Block var(__FILE__, __LINE__, __VA_ARGS__) \
 Like UT_MEMBLOCK() but allows you to name the block variable. More...
 
#define UT_MEMBLOCK_CHECK(old_var, new_var,...)
 Used with UT_MEMBLOCK_V to do intermediate check points. More...
 

Functions

void UTmemLeakDetectorReport ()
 
void UTmemLeakDetectorReportAllocsSinceLastCheckpoint ()
 
void UTmemLeakDetectorCheckPoint ()
 

Macro Definition Documentation

#define UT_MEMBLOCK (   ...)
Value:
UT_MEMLEAK_VAR(memblock) (__FILE__, __LINE__, __VA_ARGS__) \
#define UT_MEMLEAK_VAR(name)

A memory block to track memory growth: UT_MEMBLOCK(const char *label = nullptr, bool dump_leaks = false)

On debug Windows builds, the dump_leaks option will also try to summarize the outstanding memory allocations using the debug heap.

Definition at line 119 of file UT_MemLeakDetector.h.

#define UT_MEMBLOCK_CHECK (   old_var,
  new_var,
  ... 
)
Value:
old_var.end(); \
UT_MemLeakDetectorImpl::Block new_var(__FILE__, __LINE__, __VA_ARGS__) \

Used with UT_MEMBLOCK_V to do intermediate check points.

Definition at line 130 of file UT_MemLeakDetector.h.

#define UT_MEMBLOCK_V (   var,
  ... 
)    UT_MemLeakDetectorImpl::Block var(__FILE__, __LINE__, __VA_ARGS__) \

Like UT_MEMBLOCK() but allows you to name the block variable.

Definition at line 125 of file UT_MemLeakDetector.h.

#define UT_MEMLEAK_CONCAT (   x,
  y 
)    UT_MEMLEAK_CONCAT_IMPL(x, y)

Definition at line 111 of file UT_MemLeakDetector.h.

#define UT_MEMLEAK_CONCAT_IMPL (   x,
  y 
)    x ## y

Definition at line 110 of file UT_MemLeakDetector.h.

#define UT_MEMLEAK_VAR (   name)    UT_MEMLEAK_CONCAT(name, __COUNTER__)

Definition at line 112 of file UT_MemLeakDetector.h.

Function Documentation

void UTmemLeakDetectorCheckPoint ( )
inline

Definition at line 40 of file UT_MemLeakDetector.h.

void UTmemLeakDetectorReport ( )
inline

Definition at line 38 of file UT_MemLeakDetector.h.

void UTmemLeakDetectorReportAllocsSinceLastCheckpoint ( )
inline

Definition at line 39 of file UT_MemLeakDetector.h.