Finding Memory Leaks class using the CRT Library.
More...
#include <memorywatch.h>
|
|
using | CurrentMemoryState = _CrtMemState |
| | Memory state structure at some key point (used for passing to _CrtMemCheckpoint)
|
| |
|
| static bool | EnableMemoryLeakChecking (const std::string &reportFilePath="", MemoryWatchReport leakReport=MemoryWatchReport::fileAndOutput) |
| | EnableMemoryLeakChecking Enables memory leak reporting in your application. More...
|
| |
| static void | SetMemoryCheckpoint (_CrtMemState *state) |
| | Function fills in the structure (_CrtMemState) with a snapshot of the current memory state. More...
|
| |
| 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 difference of oldState and newState. More...
|
| |
| static void | DumpMemoryCheckpointsLog (_CrtMemState const *state) |
| | DumpMemoryCheckpointsLog Outputs a dump of memory state. More...
|
| |
Finding Memory Leaks class using the CRT Library.
◆ CompareMemoryCheckpoints()
| static int MemoryWatch::CompareMemoryCheckpoints |
( |
_CrtMemState * |
difference, |
|
|
_CrtMemState const * |
oldState, |
|
|
_CrtMemState const * |
newState |
|
) |
| |
|
static |
CompareMemoryCheckpoints compares the memory states oldState and newState and returns a result in the difference of oldState and newState.
- Parameters
-
| difference | A _CrtMemState pointer. |
| oldState | A constant _CrtMemState pointer. |
| newState | A constant _CrtMemState pointer. |
- Returns
- int If return value is different from 0 then memory leak occured.
◆ DumpMemoryCheckpointsLog()
| static void MemoryWatch::DumpMemoryCheckpointsLog |
( |
_CrtMemState const * |
state | ) |
|
|
static |
DumpMemoryCheckpointsLog Outputs a dump of memory state.
- Parameters
-
| state | A constant _CrtMemState pointer. |
◆ EnableMemoryLeakChecking()
| static bool MemoryWatch::EnableMemoryLeakChecking |
( |
const std::string & |
reportFilePath = "", |
|
|
MemoryWatchReport |
leakReport = MemoryWatchReport::fileAndOutput |
|
) |
| |
|
static |
EnableMemoryLeakChecking Enables memory leak reporting in your application.
- Parameters
-
| reportFilePath | A constant string with path to memory leak report file. |
| leakReport | A MemoryWatchReport type (file, file and output, file and window or all). |
- Returns
- bool If true then memory leak checking is turned on.
◆ SetMemoryCheckpoint()
| static void MemoryWatch::SetMemoryCheckpoint |
( |
_CrtMemState * |
state | ) |
|
|
static |
Function fills in the structure (_CrtMemState) with a snapshot of the current memory state.
- Parameters
-
| state | A _CrtMemState pointer. |
The documentation for this class was generated from the following file:
- C:/CProjects/Libs/CommonLib/include/commonlib/memory/memorywatch.h