From c503a6d5d346749a738e3b26b339e8b960925c99 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 22 May 2014 11:41:51 +0800 Subject: [PATCH] use jemalloc only in jemalloc major version > 2 --- include/zmalloc.h | 2 +- src/zmalloc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/zmalloc.h b/include/zmalloc.h index 383f377..cacfb92 100644 --- a/include/zmalloc.h +++ b/include/zmalloc.h @@ -45,7 +45,7 @@ #error "Newer version of tcmalloc required" #endif -#elif defined(USE_JEMALLOC) +#elif defined(USE_JEMALLOC) && (JEMALLOC_VERSION_MAJOR > 2) #define ZMALLOC_LIB ("jemalloc-" __xstr(JEMALLOC_VERSION_MAJOR) "." __xstr(JEMALLOC_VERSION_MINOR) "." __xstr(JEMALLOC_VERSION_BUGFIX)) #include #if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2) diff --git a/src/zmalloc.c b/src/zmalloc.c index fad1c2b..44f6d6a 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -60,7 +60,7 @@ void zlibc_free(void *ptr) { #define calloc(count,size) tc_calloc(count,size) #define realloc(ptr,size) tc_realloc(ptr,size) #define free(ptr) tc_free(ptr) -#elif defined(USE_JEMALLOC) +#elif defined(USE_JEMALLOC) && (JEMALLOC_VERSION_MAJOR > 2) #include #define malloc(size) je_malloc(size) #define calloc(count,size) je_calloc(count,size)