X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/23c0cdd2ad8b15defab56eca89a42c67cadd9a34..d445988c68bd795b1f9b79057513d46b062f4596:/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