summaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2015-11-12 19:06:41 (GMT)
committerJason Evans <je@fb.com>2015-11-12 19:06:41 (GMT)
commitf9e3459f751b08b3c2108fda7462827cf8a4f2af (patch)
treecf0fc3b4cf73bf05da362427b9899b8e425aed66 /src/util.c
parenta6ec1c869e1abe3eb70616d19d3e553339449636 (diff)
downloadjemalloc-f9e3459f751b08b3c2108fda7462827cf8a4f2af.zip
jemalloc-f9e3459f751b08b3c2108fda7462827cf8a4f2af.tar.gz
jemalloc-f9e3459f751b08b3c2108fda7462827cf8a4f2af.tar.bz2
Tweak code to allow compilation of concatenated src/*.c sources.
This resolves #294.
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 4cb0d6c..1373ee1 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,3 +1,7 @@
+/*
+ * Define simple versions of assertion macros that won't recurse in case
+ * of assertion failures in malloc_*printf().
+ */
#define assert(e) do { \
if (config_debug && !(e)) { \
malloc_write("<jemalloc>: Failed assertion\n"); \
@@ -648,3 +652,12 @@ malloc_printf(const char *format, ...)
malloc_vcprintf(NULL, NULL, format, ap);
va_end(ap);
}
+
+/*
+ * Restore normal assertion macros, in order to make it possible to compile all
+ * C files as a single concatenation.
+ */
+#undef assert
+#undef not_reached
+#undef not_implemented
+#include "jemalloc/internal/assert.h"