|
commonlib
|
Finding Memory Leaks Using the CRT Library (wrapper library). More...
#include "memory.h"#include <crtdbg.h>#include <Windows.h>#include <string>Go to the source code of this file.
Classes | |
| class | MemoryWatch |
| Finding Memory Leaks class using the CRT Library. More... | |
Macros | |
| #define | _CRTDBG_MAP_ALLOC |
| #define | DBG_NEW new |
Enumerations | |
| enum | MemoryWatchReport { file, fileAndOutput, fileAndWindow, all } |
Finding Memory Leaks Using the CRT Library (wrapper library).
Memory leaks, defined as the failure to correctly deallocate memory that was previously allocated, are among the most subtle and hard-to-detect bugs in C/C++ applications. A small memory leak might not be noticed at first, but over time, a progressive memory leak can cause symptoms that range from decreased performance to crashing when the application runs out of memory. Worse, a leaking application that uses up all available memory can cause another application to crash, creating confusion as to which application is responsible. Even seemingly harmless memory leaks might be symptomatic of other problems that should be corrected.
Wrapper class for C Run-Time (CRT) libraries provide you with the means for detecting and identifying memory leaks in a simple way.