diff options
author | Oran Agra <oran@redislabs.com> | 2021-04-20 08:03:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-20 08:03:58 +0300 |
commit | 959d6035e5a92e68a50b5c8443ffac537c46027b (patch) | |
tree | 19805c04dc350b956d8dae779bcfcfe43fd66d3a /src/zmalloc.h | |
parent | 92bde124caaedef0e1572765854b2deb9aa22a35 (diff) | |
parent | aa730ef1eadf7e7e603315f8a204927d33eb2be1 (diff) | |
download | redis-959d6035e5a92e68a50b5c8443ffac537c46027b.tar.gz |
Merge 6.2.2 release6.2.2
Release 6.2.2
Diffstat (limited to 'src/zmalloc.h')
-rw-r--r-- | src/zmalloc.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/zmalloc.h b/src/zmalloc.h index d44c7b389..bb4cbddbb 100644 --- a/src/zmalloc.h +++ b/src/zmalloc.h @@ -71,12 +71,21 @@ */ #ifndef ZMALLOC_LIB #define ZMALLOC_LIB "libc" + #if !defined(NO_MALLOC_USABLE_SIZE) && \ (defined(__GLIBC__) || defined(__FreeBSD__) || \ defined(USE_MALLOC_USABLE_SIZE)) + +/* Includes for malloc_usable_size() */ +#ifdef __FreeBSD__ +#include <malloc_np.h> +#else #include <malloc.h> +#endif + #define HAVE_MALLOC_SIZE 1 #define zmalloc_size(p) malloc_usable_size(p) + #endif #endif @@ -126,7 +135,7 @@ size_t zmalloc_usable_size(void *ptr); #endif #ifdef REDIS_TEST -int zmalloc_test(int argc, char **argv); +int zmalloc_test(int argc, char **argv, int accurate); #endif #endif /* __ZMALLOC_H */ |