Skip to content

Commit

Permalink
remove defrag_supported macro
Browse files Browse the repository at this point in the history
Signed-off-by: Sher Sun <[email protected]>
  • Loading branch information
Sher Sun committed Apr 30, 2024
1 parent 371641d commit b1431fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -5757,8 +5757,12 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
"mem_overhead_db_hashtable_rehashing:%zu\r\n", mh->overhead_db_hashtable_rehashing,
"active_defrag_running:%d\r\n", server.active_defrag_running,
"lazyfree_pending_objects:%zu\r\n", lazyfreeGetPendingObjectsCount(),
"lazyfreed_objects:%zu\r\n", lazyfreeGetFreedObjectsCount(),
"defrag_supported: %s\r\n", defrag_supported));
#ifdef USE_JEMALLOC
"defrag_supported: %s\r\n", "yes",
#else
"defrag_supported: %s\r\n", "no",
#endif
"lazyfreed_objects:%zu\r\n", lazyfreeGetFreedObjectsCount()));
freeMemoryOverheadData(mh);
}

Expand Down
7 changes: 0 additions & 7 deletions src/zmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

#if defined(USE_TCMALLOC)
#define ZMALLOC_LIB ("tcmalloc-" __xstr(TC_VERSION_MAJOR) "." __xstr(TC_VERSION_MINOR))
#define defrag_supported "no"
#include <google/tcmalloc.h>
#if (TC_VERSION_MAJOR == 1 && TC_VERSION_MINOR >= 6) || (TC_VERSION_MAJOR > 1)
#define HAVE_MALLOC_SIZE 1
Expand All @@ -48,7 +47,6 @@

#elif defined(USE_JEMALLOC)
#define ZMALLOC_LIB ("jemalloc-" __xstr(JEMALLOC_VERSION_MAJOR) "." __xstr(JEMALLOC_VERSION_MINOR) "." __xstr(JEMALLOC_VERSION_BUGFIX))
#define defrag_supported "yes"
#include <jemalloc/jemalloc.h>
#if (JEMALLOC_VERSION_MAJOR == 2 && JEMALLOC_VERSION_MINOR >= 1) || (JEMALLOC_VERSION_MAJOR > 2)
#define HAVE_MALLOC_SIZE 1
Expand All @@ -58,7 +56,6 @@
#endif

#elif defined(USE_MIMALLOC)
#define defrag_supported "no"
#include <mimalloc.h>
#define ZMALLOC_LIB ("mimalloc-" __xstr(MI_MALLOC_VERSION))
#define MI_VERSION_MAJOR (MI_MALLOC_VERSION / 100)
Expand Down Expand Up @@ -89,10 +86,6 @@
#define ZMALLOC_LIB "libc"
#define USE_LIBC 1

#ifndef defrag_supported
#define defrag_supported "no"
#endif

#if !defined(NO_MALLOC_USABLE_SIZE) && \
(defined(__GLIBC__) || defined(__FreeBSD__) || \
defined(__DragonFly__) || defined(__HAIKU__) || \
Expand Down

0 comments on commit b1431fa

Please sign in to comment.