1#ifndef INC_MEMORYLEAKINDICATOR_H
2#define INC_MEMORYLEAKINDICATOR_H
35 #pragma warning( disable : 4251 )
38#if __cplusplus >= 201103L
41#include <unordered_map>
43#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
45#elif defined(__GNUC__)
46 #define INT_PTR intptr_t
52#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
53 #ifdef __MEM_LEAK_INDICATOR_EXPORT_DLL
54 #define __mem_leak_indicator_export_dll __declspec(dllexport)
56 #pragma message ( "Benutze Export defines fuer __mem_leak_indicator_export_dll" )
59 #define __mem_leak_indicator_export_dll
61 #pragma message ( "Benutze Import defines fuer __mem_leak_indicator_export_dll" )
64#elif defined(__GNUC__)
65 #ifdef __MEM_LEAK_INDICATOR_EXPORT_DLL
66 #define __mem_leak_indicator_export_dll
68 #define __mem_leak_indicator_export_dll
84 #if __cplusplus >= 201103L
85 #define nullptr nullptr
349 #if __cplusplus >= 201103L
350 std::mutex m_LocalCriticalSection;
756 #pragma warning( default : 4251 )
#define __mem_leak_indicator_export_dll
Definition MemoryLeakIndicator.h:59
Class to access forgotten objects in memory. Inspired by Rainer Grimm and Mouaz Chamieh.
Definition MemoryLeakIndicator.h:274
unsigned long long numberOfProcessedObjects() const
MemoryItem * getSpyObject(INT_PTR ipAddress)
static void destroyAbsolutely()
CRITICAL_SECTION m_LocalCriticalSection
Definition MemoryLeakIndicator.h:352
static int ms_iReferenceCounter
Definition MemoryLeakIndicator.h:416
std::unordered_map< INT_PTR, MemoryItem * >::iterator m_ObjectListIterator
Definition MemoryLeakIndicator.h:377
bool leakMapUseAllowed() const
std::size_t sizeOfObjectList() const
void insertSpyObject(void *pNewObject, char const *chFileName, int iLine)
static bool ms_bUseLeakMap
Definition MemoryLeakIndicator.h:405
void removeSpyObject(void *pObjectToDelete)
std::unordered_map< INT_PTR, MemoryItem * > m_ObjectList
Definition MemoryLeakIndicator.h:366
static LeakMap * create()
static LeakMap * getGlobalLeakMapInstance()
MemoryItem * getSpyObject(SeekMode eMode)
unsigned long long m_ullInsertCounter
Definition MemoryLeakIndicator.h:388
void setLeakMapUseAllowed(bool bAllowed=true)
Class to be able to write a TRACE output to the output window also in Releas mode....
Definition MemoryLeakIndicator.h:248
void operator()(PCWSTR pszFormat,...)
void operator()(PCSTR pszFormat,...)
Definition MemoryLeakIndicator.h:92
bool TbExceptionMode
Definition MemoryLeakIndicator.h:105
const TiOutput OUTPUT_TRACE
Definition MemoryLeakIndicator.h:182
SeekMode
Definition MemoryLeakIndicator.h:196
@ CURRENT
Definition MemoryLeakIndicator.h:226
@ NEXT
Definition MemoryLeakIndicator.h:216
@ START
Definition MemoryLeakIndicator.h:206
const TbExceptionMode NOTHROW
Definition MemoryLeakIndicator.h:118
void __mem_leak_indicator_export_dll finishMemoryMonitoring(MemSpy::TiOutput iOutput=MemSpy::OUTPUT_CONSOLE)
const TiOutput OUTPUT_NON
Definition MemoryLeakIndicator.h:157
int TiOutput
Definition MemoryLeakIndicator.h:144
const TiOutput OUTPUT_CONSOLE
Definition MemoryLeakIndicator.h:169
const TbExceptionMode THROW
Definition MemoryLeakIndicator.h:129
__mem_leak_indicator_export_dll MemSpy::LeakMap * activateMemoryMonitoring(MemSpy::TbExceptionMode bExceptionMode=MemSpy::THROW)
Reference to the instantiated object with file name and line where it was instantiated.
Definition MemoryLeakIndicator.h:294
int m_iLineNumber
Definition MemoryLeakIndicator.h:328
INT_PTR m_pItemPtr
Definition MemoryLeakIndicator.h:306
char const * m_FileName
Definition MemoryLeakIndicator.h:317