summaryrefslogtreecommitdiff
path: root/src/zmalloc.h
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-04-20 08:03:58 +0300
committerGitHub <noreply@github.com>2021-04-20 08:03:58 +0300
commit959d6035e5a92e68a50b5c8443ffac537c46027b (patch)
tree19805c04dc350b956d8dae779bcfcfe43fd66d3a /src/zmalloc.h
parent92bde124caaedef0e1572765854b2deb9aa22a35 (diff)
parentaa730ef1eadf7e7e603315f8a204927d33eb2be1 (diff)
downloadredis-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.h11
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 */