MINOR: compat: automatically include malloc.h on glibc
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Nov 2020 14:50:40 +0000 (15:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 May 2021 05:56:36 +0000 (07:56 +0200)
commitf2fb9e58448d1a4054c8da1ad30c5972662d4ed8
tree9db44912af0a82086f91f5910b88fafcfe84cd04
parentf41d4db9d04f88e7202fd2f21f4791d4f2eb3414
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.

(cherry picked from commit 1d3c7003d91a2c3b48f0f1fee3eb361f4121057b)
[wt: CONFIG_HAP_NO_GLOBAL_POOLS was backported via commitc0457dc81
     but the optional HA_HAVE_MALLOC_TRIM was never set, and it was
     shown to help in some cases]
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/compat.h