mirror of
https://github.com/fluencelabs/redis
synced 2025-06-21 21:11:33 +00:00
add malloc_usable_size for libc malloc
this reduces the extra 8 bytes we save before each pointer. but more importantly maybe, it makes the valgrind runs to be more similiar to our normal runs. note: the change in malloc_stats struct in server.h is to eliminate an name conflict. structs that are not typedefed are resolved from a separate name space.
This commit is contained in:
@ -63,6 +63,11 @@
|
||||
|
||||
#ifndef ZMALLOC_LIB
|
||||
#define ZMALLOC_LIB "libc"
|
||||
#ifdef __GLIBC__
|
||||
#include <malloc.h>
|
||||
#define HAVE_MALLOC_SIZE 1
|
||||
#define zmalloc_size(p) malloc_usable_size(p)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* We can enable the Redis defrag capabilities only if we are using Jemalloc
|
||||
|
Reference in New Issue
Block a user