X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/59d884af8c43a82a4f3d67c55059a7c453601d05..1d82bbd4329d53fa525a3d1e00005d53641e1d0d:/src/zmalloc.c diff --git a/src/zmalloc.c b/src/zmalloc.c index 5e5598cf..79b56158 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -30,6 +30,15 @@ #include #include + +/* 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 #include #include "config.h" @@ -227,10 +236,6 @@ void zmalloc_enable_thread_safeness(void) { 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