22 #define _CRTDBG_MAP_ALLOC 30 #define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ ) 44 BEGIN_NAMESPACE_MEMORY
46 enum class MemoryWatchReport
69 MemoryWatchReport leakReport = MemoryWatchReport::fileAndOutput);
86 _CrtMemState
const* oldState,
87 _CrtMemState
const* newState);
95 static HANDLE CreateLogFile(
const std::string& reportFilePath);
96 static void SetDumpMemoryLeaksFlag();
98 static void SetLeakReportType(HANDLE hLogFile, MemoryWatchReport leakReport);
99 static void SetLeakReportDirection(
int reportType, HANDLE hLogFile,
int leakReport);
101 static int ConvertReportTypeToInt(MemoryWatchReport leakReport);
102 static std::wstring ConvertToLPWSTR(
const std::string& inputString);
static void SetMemoryCheckpoint(_CrtMemState *state)
Function fills in the structure (_CrtMemState) with a snapshot of the current memory state...
static bool EnableMemoryLeakChecking(const std::string &reportFilePath="", MemoryWatchReport leakReport=MemoryWatchReport::fileAndOutput)
EnableMemoryLeakChecking Enables memory leak reporting in your application.
Finding Memory Leaks class using the CRT Library.
Definition: memorywatch.h:57
_CrtMemState CurrentMemoryState
Memory state structure at some key point (used for passing to _CrtMemCheckpoint)
Definition: memorywatch.h:60
static void DumpMemoryCheckpointsLog(_CrtMemState const *state)
DumpMemoryCheckpointsLog Outputs a dump of memory state.
static int CompareMemoryCheckpoints(_CrtMemState *difference, _CrtMemState const *oldState, _CrtMemState const *newState)
CompareMemoryCheckpoints compares the memory states oldState and newState and returns a result in the...