use jemalloc only in jemalloc major version > 2

This commit is contained in:
c9s 2014-05-22 11:41:51 +08:00
parent 1fdfaef16e
commit c503a6d5d3
2 changed files with 2 additions and 2 deletions

View file

@ -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 <jemalloc/jemalloc.h>
#if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2)

View file

@ -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 <jemalloc/jemalloc.h>
#define malloc(size) je_malloc(size)
#define calloc(count,size) je_calloc(count,size)