summaryrefslogtreecommitdiff
path: root/src/zmalloc.h
diff options
context:
space:
mode:
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 */