From 0a802bd7a0aff807145470ed43cf84a435e2a615 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 22 Oct 2010 00:06:44 +0200 Subject: [PATCH] support for compiling with tcmalloc --- README | 15 +++++++++++++++ src/Makefile | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/README b/README index 1f0a1fe6..e3f3a354 100644 --- a/README +++ b/README @@ -27,6 +27,21 @@ After you build Redis is a good idea to test it, using: % make test +Buliding using tcmalloc +----------------------- + +tcmalloc is a fast and space efficient implementation of malloc(). Compiling +Redis with it can improve performances and memeory usage. You can read +more about it here: http://goog-perftools.sourceforge.net/doc/tcmalloc.html + +In order to compile Redis with tcmalloc support install tcmalloc on your system +and then use: + + % make USE_TCMALLOC=yes + +Note that you can pass any other target to make, as long as you append +USE_TCMALLOC=yes at the end. + Running Redis ------------- diff --git a/src/Makefile b/src/Makefile index e1e989c6..dd18b2c7 100644 --- a/src/Makefile +++ b/src/Makefile @@ -12,6 +12,10 @@ else CFLAGS?= -std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF) CCLINK?= -lm -pthread endif + +ifeq ($(USE_TCMALLOC),yes) + CCLINK+= -ltcmalloc +endif CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF) DEBUG?= -g -rdynamic -ggdb -- 2.45.2