summaryrefslogtreecommitdiffstats
path: root/runtime/debug.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-10-22 11:33:38 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-10-22 11:33:38 +0200
commite04e1b50025f5fa9c26abd946190dce8f797d08f (patch)
treeb5348b56bbd4b72ff713c2650cd4661318f8e8b1 /runtime/debug.h
parent9079f6683057c5aad0a73eb56e33a1f1445f6e65 (diff)
downloadrsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.tar.gz
rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.tar.xz
rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.zip
enhanced test environment (including testbench)
support for enhancing probability of memory addressing failure by using non-NULL default value for malloced memory (optional, only if requested by configure option). This helps to track down some otherwise undetected issues within the testbench and is expected to be very useful in the future.
Diffstat (limited to 'runtime/debug.h')
-rw-r--r--runtime/debug.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/debug.h b/runtime/debug.h
index dcbfb930..8d9c1ceb 100644
--- a/runtime/debug.h
+++ b/runtime/debug.h
@@ -3,7 +3,7 @@
* Definitions for the debug and run-time analysis support module.
* Contains a lot of macros.
*
- * Copyright 2008 Rainer Gerhards and Adiscon GmbH.
+ * Copyright 2008, 2009 Rainer Gerhards and Adiscon GmbH.
*
* This file is part of the rsyslog runtime library.
*
@@ -99,6 +99,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__); }
@@ -126,6 +127,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