]>
git.saurik.com Git - redis.git/blob - src/config.h
5 #include <AvailabilityMacros.h>
8 /* Use tcmalloc's malloc_size() when available.
9 * When tcmalloc is used, native OSX malloc_size() may never be used because
10 * this expects a different allocation scheme. Therefore, *exclusively* use
11 * either tcmalloc or OSX's malloc_size()! */
12 #if defined(USE_TCMALLOC)
13 #include <google/tcmalloc.h>
14 #if TC_VERSION_MAJOR >= 1 && TC_VERSION_MINOR >= 6
15 #define HAVE_MALLOC_SIZE 1
16 #define redis_malloc_size(p) tc_malloc_size(p)
18 #elif defined(__APPLE__)
19 #include <malloc/malloc.h>
20 #define HAVE_MALLOC_SIZE 1
21 #define redis_malloc_size(p) malloc_size(p)
24 /* define redis_fstat to fstat or fstat64() */
25 #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
26 #define redis_fstat fstat64
27 #define redis_stat stat64
29 #define redis_fstat fstat
30 #define redis_stat stat
33 /* test for proc filesystem */
38 /* test for task_info() */
39 #if defined(__APPLE__)
40 #define HAVE_TASKINFO 1
43 /* test for backtrace() */
44 #if defined(__APPLE__) || defined(__linux__)
45 #define HAVE_BACKTRACE 1
48 /* test for polling API */
53 #if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
57 /* define aof_fsync to fdatasync() in Linux and fsync() for all the rest */
59 #define aof_fsync fdatasync
61 #define aof_fsync fsync