- disable some debug prints on non-debug versions

This commit is contained in:
Ilya Shurumov 2021-05-31 00:25:39 +06:00 committed by InspirationByte
parent e57fa7de29
commit c0cc23416c
2 changed files with 10 additions and 4 deletions

View File

@ -189,8 +189,8 @@ const int TAIL_GETTINGFAR = 12900;
const int TAIL_TOOCLOSE = 4000;
const int TAIL_TOOFAR = 15900;
#ifdef DEBUG_OPTIONS
#define MR_DebugPrint //printInfo
#ifdef _DEBUG
#define MR_DebugPrint // printInfo
#define MR_DebugWarn printWarning
#else
#define MR_DebugPrint

View File

@ -45,6 +45,12 @@ extern void sys_freeall();
#define D_TEMPFREE()
#endif
#ifdef _DEBUG
#define DMalloc_DebugPrint printWarning
#else
#define DMalloc_DebugPrint (void)
#endif
#define D_MALLOC_BEGIN() \
{ \
volatile const char* _oldmalloc = mallocptr;
@ -53,13 +59,13 @@ extern void sys_freeall();
#define D_MALLOC_END() \
D_TEMPFREE();\
if(mallocptr > _oldmalloc)\
printWarning("malloc(%d) in %s, line %d. Malloc usage: %d\n", mallocptr-_oldmalloc, __FUNCTION__, __LINE__, (mallocptr-malloctab));\
DMalloc_DebugPrint("malloc(%d) in %s, line %d. Malloc usage: %d\n", mallocptr-_oldmalloc, __FUNCTION__, __LINE__, (mallocptr-malloctab));\
} // D_MALLOC_BEGIN block
#else
#define D_MALLOC_END() \
D_TEMPFREE();\
if(mallocptr > _oldmalloc)\
printWarning("malloc(%d) in " __FUNCTION__ ", line %d. Malloc usage: %d\n", mallocptr-_oldmalloc, __LINE__, (mallocptr-malloctab));\
DMalloc_DebugPrint("malloc(%d) in " __FUNCTION__ ", line %d. Malloc usage: %d\n", mallocptr-_oldmalloc, __LINE__, (mallocptr-malloctab));\
} // D_MALLOC_BEGIN block
#endif