Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d94ac406
Commit
d94ac406
authored
Oct 23, 2010
by
Pieter Noordhuis
Browse files
Exclusively use either tcmalloc or OSX's native malloc_size()
parent
7cdc98b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/config.h
View file @
d94ac406
...
@@ -5,17 +5,17 @@
...
@@ -5,17 +5,17 @@
#include <AvailabilityMacros.h>
#include <AvailabilityMacros.h>
#endif
#endif
/* use tcmalloc's malloc_size() when available */
/* Use tcmalloc's malloc_size() when available.
* When tcmalloc is used, native OSX malloc_size() may never be used because
* this expects a different allocation scheme. Therefore, *exclusively* use
* either tcmalloc or OSX's malloc_size()! */
#if defined(USE_TCMALLOC)
#if defined(USE_TCMALLOC)
#include <google/tcmalloc.h>
#include <google/tcmalloc.h>
#if TC_VERSION_MAJOR >= 1 && TC_VERSION_MINOR >= 6
#if TC_VERSION_MAJOR >= 1 && TC_VERSION_MINOR >= 6
#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
#endif
#elif defined(__APPLE__)
/* fallback to native malloc_size() for osx */
#if defined(__APPLE__) && !defined(HAVE_MALLOC_SIZE)
#include <malloc/malloc.h>
#include <malloc/malloc.h>
#define HAVE_MALLOC_SIZE 1
#define HAVE_MALLOC_SIZE 1
#define redis_malloc_size(p) malloc_size(p)
#define redis_malloc_size(p) malloc_size(p)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment