15 #ifndef __UT_MemLeakDetector_h__
16 #define __UT_MemLeakDetector_h__
23 #if !defined(WIN32) || !defined(_DEBUG)
25 #undef UT_MEMLEAKDETECTOR_ENABLE
29 #define UT_MEMLEAKDETECTOR_ENABLE
36 #ifndef UT_MEMLEAKDETECTOR_ENABLE
44 #ifndef UT_MEMLEAKDETCTOR_DISABLE_MAP_ALLOC
48 #define _CRTDBG_MAP_ALLOC
59 #endif // UT_MEMLEAKDETCTOR_DISABLE_MAP_ALLOC
70 UT_API void UTmemLeakDetectorCheckpoint();
72 #endif // UT_MEMLEAK_DETECTOR_ENABLE
75 namespace UT_MemLeakDetectorImpl
84 const char *
label =
nullptr,
85 bool dump_leaks =
false);
95 void end(
bool dump_leaks =
false);
97 #ifdef UT_MEMLEAKDETECTOR_ENABLE
110 #define UT_MEMLEAK_CONCAT_IMPL(x, y) x ## y
111 #define UT_MEMLEAK_CONCAT(x, y) UT_MEMLEAK_CONCAT_IMPL(x, y)
112 #define UT_MEMLEAK_VAR(name) UT_MEMLEAK_CONCAT(name, __COUNTER__)
119 #define UT_MEMBLOCK(...) \
120 UT_MemLeakDetectorImpl::Block \
121 UT_MEMLEAK_VAR(memblock) (__FILE__, __LINE__, __VA_ARGS__) \
125 #define UT_MEMBLOCK_V(var, ...) \
126 UT_MemLeakDetectorImpl::Block var(__FILE__, __LINE__, __VA_ARGS__) \
130 #define UT_MEMBLOCK_CHECK(old_var, new_var, ...) \
132 UT_MemLeakDetectorImpl::Block new_var(__FILE__, __LINE__, __VA_ARGS__) \
136 #endif // __UT_MemLeakDetector_h__
GLuint GLsizei const GLchar * label
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void UTmemLeakDetectorCheckPoint()
void UTmemLeakDetectorReportAllocsSinceLastCheckpoint()
void UTmemLeakDetectorReport()
PcpNodeRef_ChildrenIterator begin(const PcpNodeRef::child_const_range &r)
Support for range-based for loops for PcpNodeRef children ranges.