#include <stdio.h>
#include <stdlib.h>
+
+/* This function provide us access to the original libc free(). This is useful
+ * for instance to free results obtained by backtrace_symbols(). We need
+ * to define this function before including zmalloc.h that may shadow the
+ * free implementation if we use jemalloc or another non standard allocator. */
+void zlibc_free(void *ptr) {
+ free(ptr);
+}
+
#include <string.h>
#include <pthread.h>
#include "config.h"
zmalloc_thread_safe = 1;
}
-void zlibc_free(void *ptr) {
- free(ptr);
-}
-
/* Get the RSS information in an OS-specific way.
*
* WARNING: the function zmalloc_get_rss() is not designed to be fast