MINOR: activity/memprofile: monitor non-portable calls as well
authorWilly Tarreau <w@1wt.eu>
Thu, 21 Nov 2024 08:12:58 +0000 (09:12 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 9 Jan 2025 14:56:04 +0000 (15:56 +0100)
commit3985fa47333cdd841227d64a9c65eff0f18773cd
treea0e039c5dece75beaeffcd452dbeb7a21347d42a
parent1a9607b2cfc58a935f7245eafee5de0ba8e3062b
MINOR: activity/memprofile: monitor non-portable calls as well

Some dependencies might very well rely on posix_memalign(), strndup()
or other less portable callsn making us miss them when chasing memory
leaks, resulting in negative global allocation counters. Let's provide
the handlers for the following functions:

  strndup()        // _POSIX_C_SOURCE >= 200809L || glibc >= 2.10
  valloc()         // _BSD_SOURCE || _XOPEN_SOURCE>=500 || glibc >= 2.12
  aligned_alloc()  // _ISOC11_SOURCE
  posix_memalign() // _POSIX_C_SOURCE >= 200112L
  memalign()       // obsolete
  pvalloc()        // obsolete

This time we don't fail if they're not found, we just silently forward
the calls.

(cherry picked from commit 5ddc8b3ad4190583aa6f0996a7401d6f2d4fe78e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/activity-t.h
src/activity.c