Don't bother looking for memory leaks in 'testing' builds
This was SVN commit r803.
This commit is contained in:
parent
2bd2dfd6ab
commit
5ea728fd28
@ -38,7 +38,7 @@
|
|||||||
# define HAVE_PCH
|
# define HAVE_PCH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(HAVE_PCH) && !defined(NDEBUG)
|
#if defined(_MSC_VER) && defined(HAVE_PCH) && !( defined(NDEBUG) || defined(TESTING) )
|
||||||
# define HAVE_DEBUGALLOC
|
# define HAVE_DEBUGALLOC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ static inline void pre_libc_init()
|
|||||||
|
|
||||||
static inline void pre_main_init()
|
static inline void pre_main_init()
|
||||||
{
|
{
|
||||||
#ifndef NDEBUG
|
#ifdef HAVE_DEBUGALLOC
|
||||||
uint flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
|
uint flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
|
||||||
// Always enable leak detection in debug builds
|
// Always enable leak detection in debug builds
|
||||||
flags |= _CRTDBG_LEAK_CHECK_DF;
|
flags |= _CRTDBG_LEAK_CHECK_DF;
|
||||||
@ -305,7 +305,7 @@ static inline void pre_main_init()
|
|||||||
flags |= _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF;
|
flags |= _CRTDBG_CHECK_ALWAYS_DF | _CRTDBG_DELAY_FREE_MEM_DF;
|
||||||
#endif // PARANOIA
|
#endif // PARANOIA
|
||||||
_CrtSetDbgFlag(flags);
|
_CrtSetDbgFlag(flags);
|
||||||
#endif // !NDEBUG
|
#endif // HAVE_DEBUGALLOC
|
||||||
|
|
||||||
call_func_tbl(init_begin, init_end);
|
call_func_tbl(init_begin, init_end);
|
||||||
|
|
||||||
@ -316,6 +316,12 @@ static inline void pre_main_init()
|
|||||||
// (w)sdl will take care of it anyway.
|
// (w)sdl will take care of it anyway.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Enable heap corruption checking after every allocation. Has the same
|
||||||
|
// effect as PARANOIA in pre_main_init, but lets you switch it on anywhere
|
||||||
|
// so that you can skip checking the whole of the initialisation code.
|
||||||
|
// The debugger will break in the allocation just after the one that
|
||||||
|
// corrupted the heap, so check its ID and then _CrtSetBreakAlloc(...)
|
||||||
|
// on the previous one and try again.
|
||||||
// Warning: This makes things rather slow.
|
// Warning: This makes things rather slow.
|
||||||
void memory_debug_extreme_turbo_plus()
|
void memory_debug_extreme_turbo_plus()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user