]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD/MINOR: memprof fix macOs build.
authorDavid CARLIER <devnexen@gmail.com>
Tue, 20 Jul 2021 19:37:45 +0000 (20:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Jul 2021 08:22:48 +0000 (10:22 +0200)
this platform has a similar malloc_usable_size too.

include/haproxy/compat.h

index 03775649449a737680fbb4515e721d2435d9d305..72dc3dc4f9b38e2364ca68e9613a567d9088571c 100644 (file)
@@ -277,6 +277,12 @@ typedef struct { } empty_t;
 #include <malloc_np.h>
 #endif
 
+/* macOS has a call similar to malloc_usable_size */
+#if defined(USE_MEMORY_PROFILING) && defined(__APPLE__)
+#include <malloc/malloc.h>
+#define malloc_usable_size malloc_size
+#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.
  */