Print error during build when MEMORY_USAGE is requested but the build is done without DEBUG_MALLOC.
Signed-off-by: Sven Eckelmann sven@narfation.org --- allocate.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/allocate.c b/allocate.c index c6c3082..fe61847 100644 --- a/allocate.c +++ b/allocate.c @@ -32,6 +32,10 @@
#if defined DEBUG_MALLOC
+#ifndef MEMORY_USAGE +#error DEBUG_MALLOC can only be used together with MEMORY_USAGE +#endif + static pthread_mutex_t chunk_mutex = PTHREAD_MUTEX_INITIALIZER;
struct chunkHeader *chunkList = NULL;