From: Willy Tarreau Date: Sun, 9 May 2021 21:46:45 +0000 (+0200) Subject: BUILD: compat: include malloc_np.h for USE_MEMORY_PROFILING on FreeBSD X-Git-Tag: v2.4-dev19~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9bc457f0eafd171b8f148ff754c4ec081396916c;p=thirdparty%2Fhaproxy.git BUILD: compat: include malloc_np.h for USE_MEMORY_PROFILING on FreeBSD This include is needed for malloc_usable_size(). It's also important to think about disabling global pools. --- diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h index 39d46c2be0..0377564944 100644 --- a/include/haproxy/compat.h +++ b/include/haproxy/compat.h @@ -272,6 +272,11 @@ typedef struct { } empty_t; #define HA_HAVE_FAST_MALLOC #endif +/* FreeBSD also has malloc_usable_size() but it requires malloc_np.h */ +#if defined(USE_MEMORY_PROFILING) && defined(__FreeBSD__) && (__FreeBSD_version >= 700002) +#include +#endif + /* Max number of file descriptors we send in one sendmsg(). Linux seems to be * able to send 253 fds per sendmsg(), not sure about the other OSes. */