Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don’t worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Showing with 15 additions and 21 deletions.
  1. +7 −7 redis.conf
  2. +3 −9 src/Makefile
  3. +4 −4 src/zmalloc.c
  4. +1 −1 src/zmalloc.h
View
14 redis.conf
@@ -14,11 +14,11 @@
# By default Redis does not run as a daemon. Use 'yes' if you need it.
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized.
-daemonize no
+daemonize yes
# When running daemonized, Redis writes a pid file in /var/run/redis.pid by
# default. You can specify a custom pid file location here.
-pidfile /var/run/redis.pid
+pidfile /var/run/redis/redis.pid
# Accept connections on the specified port, default is 6379.
# If port 0 is specified Redis will not listen on a TCP socket.
@@ -27,7 +27,7 @@ port 6379
# If you want you can bind a single interface, if the bind option is not
# specified all the interfaces will listen for incoming connections.
#
-# bind 127.0.0.1
+bind 127.0.0.1
# Specify the path for the unix socket that will be used to listen for
# incoming connections. There is no default, so Redis will not listen
@@ -50,7 +50,7 @@ loglevel notice
# Specify the log file name. Also 'stdout' can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile stdout
+logfile /var/log/redis/redis.log
# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
@@ -124,7 +124,7 @@ rdbcompression yes
rdbchecksum yes
# The filename where to dump the DB
-dbfilename dump.rdb
+dbfilename /var/lib/redis/dump.rdb
# The working directory.
#
@@ -134,7 +134,7 @@ dbfilename dump.rdb
# Also the Append Only File will be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
-dir ./
+dir /var/lib/redis/
################################# REPLICATION #################################
@@ -278,7 +278,7 @@ slave-priority 100
# limit for maxmemory so that there is some free RAM on the system for slave
# output buffers (but this is not needed if the policy is 'noeviction').
#
-# maxmemory <bytes>
+maxmemory 67108864
# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached? You can select among five behavior:
View
12 src/Makefile
@@ -22,12 +22,7 @@ STD= -std=c99 -pedantic
WARN= -Wall
OPT= $(OPTIMIZATION)
-# Default allocator
-ifeq ($(uname_S),Linux)
- MALLOC=jemalloc
-else
- MALLOC=libc
-endif
+MALLOC?=jemalloc
# Backwards compatibility for selecting an allocator
ifeq ($(USE_TCMALLOC),yes)
@@ -71,9 +66,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
endif
ifeq ($(MALLOC),jemalloc)
- DEPENDENCY_TARGETS+= jemalloc
- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
- FINAL_LIBS+= ../deps/jemalloc/lib/libjemalloc.a -ldl
+ FINAL_CFLAGS+= -DUSE_JEMALLOC
+ FINAL_LIBS+= -ljemalloc -ldl
endif
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
View
8 src/zmalloc.c
@@ -61,10 +61,10 @@ void zlibc_free(void *ptr) {
#define realloc(ptr,size) tc_realloc(ptr,size)
#define free(ptr) tc_free(ptr)
#elif defined(USE_JEMALLOC)
-#define malloc(size) je_malloc(size)
-#define calloc(count,size) je_calloc(count,size)
-#define realloc(ptr,size) je_realloc(ptr,size)
-#define free(ptr) je_free(ptr)
+#define malloc(size) jmalloc(size)
+#define calloc(count,size) jcalloc(count,size)
+#define realloc(ptr,size) jrealloc(ptr,size)
+#define free(ptr) jfree(ptr)
#endif
#ifdef HAVE_ATOMIC
View
2 src/zmalloc.h
@@ -50,7 +50,7 @@
#include <jemalloc/jemalloc.h>
#if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2)
#define HAVE_MALLOC_SIZE 1
-#define zmalloc_size(p) je_malloc_usable_size(p)
+#define zmalloc_size(p) jmalloc_usable_size(p)
#else
#error "Newer version of jemalloc required"
#endif

No commit comments for this range

Something went wrong with that request. Please try again.