mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
More allocators
This commit is contained in:
parent
ded614f803
commit
5282562117
18
src/Makefile
18
src/Makefile
@ -16,9 +16,23 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USE_TCMALLOC),yes)
|
ifeq ($(USE_TCMALLOC),yes)
|
||||||
CCLINK+= -ltcmalloc
|
ALLOC_LINK=-ltcmalloc
|
||||||
CFLAGS+= -DUSE_TCMALLOC
|
ALLOC_FLAGS=-DUSE_TCMALLOC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_TCMALLOC_MINIMAL),yes)
|
||||||
|
ALLOC_LINK=-ltcmalloc_minimal
|
||||||
|
ALLOC_FLAGS=-DUSE_TCMALLOC
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(USE_JEMALLOC),yes)
|
||||||
|
ALLOC_LINK=-ljemalloc
|
||||||
|
ALLOC_FLAGS=-DUSE_JEMALLOC
|
||||||
|
endif
|
||||||
|
|
||||||
|
CCLINK+= $(ALLOC_LINK)
|
||||||
|
CFLAGS+= $(ALLOC_FLAGS)
|
||||||
|
|
||||||
CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF)
|
CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF)
|
||||||
|
|
||||||
PREFIX= /usr/local
|
PREFIX= /usr/local
|
||||||
|
@ -15,6 +15,13 @@
|
|||||||
#define HAVE_MALLOC_SIZE 1
|
#define HAVE_MALLOC_SIZE 1
|
||||||
#define redis_malloc_size(p) tc_malloc_size(p)
|
#define redis_malloc_size(p) tc_malloc_size(p)
|
||||||
#endif
|
#endif
|
||||||
|
#elif defined(USE_JEMALLOC)
|
||||||
|
#define JEMALLOC_MANGLE
|
||||||
|
#include <jemalloc/jemalloc.h>
|
||||||
|
#if JEMALLOC_VERSION_MAJOR >= 2 && JEMALLOC_VERSION_MINOR >= 1
|
||||||
|
#define HAVE_MALLOC_SIZE 1
|
||||||
|
#define redis_malloc_size(p) JEMALLOC_P(malloc_usable_size)(p)
|
||||||
|
#endif
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#include <malloc/malloc.h>
|
#include <malloc/malloc.h>
|
||||||
#define HAVE_MALLOC_SIZE 1
|
#define HAVE_MALLOC_SIZE 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user