mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-11 09:52:56 -04:00
MINOR: compat: automatically include malloc.h on glibc
This is in order to access malloc_trim() which is convenient after clearing huge maps to reclaim memory. When this is detected, we also define HA_HAVE_MALLOC_TRIM.
This commit is contained in:
parent
32186472cb
commit
1d3c7003d9
1 changed files with 9 additions and 0 deletions
|
|
@ -240,6 +240,15 @@ typedef struct { } empty_t;
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* malloc_trim() can be very convenient to reclaim unused memory especially
|
||||
* from huge pattern files. It's available (and really usable) in glibc 2.8 and
|
||||
* above.
|
||||
*/
|
||||
#if (defined(__GNU_LIBRARY__) && (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 8))
|
||||
#include <malloc.h>
|
||||
#define HA_HAVE_MALLOC_TRIM
|
||||
#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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue