From 31bbf1ba735cbeff5640424d5d0c06a94614764d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 15 Sep 2009 22:14:56 +0200 Subject: detect alternative memory allocators and quit early --- mutrace.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mutrace.c b/mutrace.c index 069fd72..d5ddae2 100644 --- a/mutrace.c +++ b/mutrace.c @@ -35,6 +35,7 @@ #include #include #include +#include /* FIXMES: * @@ -221,6 +222,15 @@ static void setup(void) { if (initialized) return; + if (__malloc_hook) { + fprintf(stderr, + "mutrace: Detected non-glibc memory allocator. Your program uses some\n" + "mutrace: alternative memory allocator (jemalloc?) which is not compatible with\n" + "mutrace: mutrace. Please rebuild your program with the standard memory\n" + "mutrace: allocator or fix mutrace to handle yours correctly.\n"); + real_exit(1); + } + t = hash_size; if (parse_env("MUTRACE_HASH_SIZE", &t) < 0 || t <= 0) fprintf(stderr, "mutrace: WARNING: Failed to parse $MUTRACE_HASH_SIZE.\n"); -- cgit