2016-02-10 14:22:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// Utility file for using the MS CRT's memory tracking.
|
|
|
|
// crtdbg.h overloads malloc with malloc_dbg etc, but does not catch new. So here we go.
|
|
|
|
|
2022-04-23 20:52:28 +00:00
|
|
|
// To add a full check of memory overruns, throw in a _CrtCheckMemory(). Useful to narrow things down.
|
|
|
|
|
2016-02-10 14:22:28 +00:00
|
|
|
#include <crtdbg.h>
|
|
|
|
|
2017-02-15 10:58:21 +00:00
|
|
|
#if defined(_DEBUG)
|
2016-02-10 14:22:28 +00:00
|
|
|
#define USE_CRT_DBG
|
|
|
|
#ifndef DBG_NEW
|
|
|
|
#define DBG_NEW new ( _NORMAL_BLOCK , __FILE__ , __LINE__ )
|
|
|
|
#define new DBG_NEW
|
|
|
|
#endif
|
|
|
|
|
2019-05-19 13:23:25 +00:00
|
|
|
#endif // _DEBUG
|