summaryrefslogtreecommitdiffstats
path: root/runtime/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/debug.h')
-rw-r--r--runtime/debug.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/debug.h b/runtime/debug.h
index 8eb46313..717c0fef 100644
--- a/runtime/debug.h
+++ b/runtime/debug.h
@@ -102,6 +102,7 @@ void dbgExitFunc(dbgFuncDB_t *pFuncDB, int iStackPtrRestore, int iRet);
void dbgSetExecLocation(int iStackPtr, int line);
void dbgSetThrdName(uchar *pszName);
void dbgPrintAllDebugInfo(void);
+void *dbgmalloc(size_t size);
/* macros */
#define DBGPRINTF(...) if(Debug) { dbgprintf(__VA_ARGS__); }
@@ -129,6 +130,12 @@ void dbgPrintAllDebugInfo(void);
# define RUNLOG_STR(str)
#endif
+#ifdef MEMCHECK
+# define MALLOC(x) dbgmalloc(x)
+#else
+# define MALLOC(x) malloc(x)
+#endif
+
/* mutex operations */
#define MUTOP_LOCKWAIT 1
#define MUTOP_LOCK 2