X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/9e83ac06ef1c978c65fefc1fbf5af1e95f31fe15..21dbc6499a538af07f52a41742cf1683f3fc9c23:/src/zmalloc.c diff --git a/src/zmalloc.c b/src/zmalloc.c index 544155e7..8cfb18d9 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -32,13 +32,24 @@ #include #include #include - #include "config.h" +#ifdef HAVE_MALLOC_SIZE +#define PREFIX_SIZE (0) +#else #if defined(__sun) -#define PREFIX_SIZE sizeof(long long) +#define PREFIX_SIZE (sizeof(long long)) #else -#define PREFIX_SIZE sizeof(size_t) +#define PREFIX_SIZE (sizeof(size_t)) +#endif +#endif + +/* Explicitly override malloc/free etc when using tcmalloc. */ +#if defined(USE_TCMALLOC) +#define malloc(size) tc_malloc(size) +#define calloc(count,size) tc_calloc(count,size) +#define realloc(ptr,size) tc_realloc(ptr,size) +#define free(ptr) tc_free(ptr) #endif #define increment_used_memory(__n) do { \