]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: compat: include malloc_np.h for USE_MEMORY_PROFILING on FreeBSD
authorWilly Tarreau <w@1wt.eu>
Sun, 9 May 2021 21:46:45 +0000 (23:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 9 May 2021 21:46:45 +0000 (23:46 +0200)
This include is needed for malloc_usable_size(). It's also important to
think about disabling global pools.

include/haproxy/compat.h

index 39d46c2be0e3ef3afdf34b016fb6b439bddc904d..03775649449a737680fbb4515e721d2435d9d305 100644 (file)
@@ -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 <malloc_np.h>
+#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.
  */