]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
helper/log: Fix build using _DEBUG_FREE_SPACE_
authorAntonio Borneo <borneo.antonio@gmail.com>
Tue, 20 Feb 2024 02:11:07 +0000 (20:11 -0600)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 25 Jan 2025 10:36:51 +0000 (10:36 +0000)
commitfceccde0b394cff9127dca13708ef689094c9975
treec10fc1a48bbad69179fe1fe73ce2ecfeebb81988
parent8038e2f7548792a090bdd255ec6bfbf4128fead7
helper/log: Fix build using _DEBUG_FREE_SPACE_

The glibc API 'mallinfo' is deprecated and the new 'mallinfo2'
should be used from glibc 2.33 (2021-02-01).

Throw an error when '--enable-malloc-logging' is used on systems
that compile without glibc.
Detect the glibc version and, for backward compatibility, define
'mallinfo2' as the old 'mallinfo'. Define a macro for the format
of 'fordblks'.

Change-Id: I68bff7b1b58f0ec2669db0b911f19c1c5a26ed30
Reported-by: Steven J. Hill <steven.hill@konsulko.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8589
Tested-by: jenkins
src/helper/log.c