mallinfo-util: assume mallinfo() exists

The check existed for musl. Let's remove it, as we explicitly request glibc.

While removing the check, this also drops generic_mallinfo, introduces
a tiny converter from struct mallinfo to struct mallinfo2 if mallinfo2()
does not exist, and renames mallinfo-util.h to malloc.h.

With this change, we can drop many ifdefs and casts in .c files.
This commit is contained in:
Yu Watanabe
2025-06-10 00:39:38 +09:00
committed by Lennart Poettering
parent 17f2b40f22
commit abb99d3168
5 changed files with 50 additions and 54 deletions

View File

@@ -588,7 +588,6 @@ foreach ident : [
['get_mempolicy', '''#include <sys/syscall.h>'''], # declared at numaif.h provided by libnuma, which we do not use
['posix_getdents', '''#include <dirent.h>'''], # glibc does not implement it, but musl does
['strerrorname_np', '''#include <string.h>'''], # since glibc-2.32
['mallinfo', '''#include <malloc.h>'''], # deprecated since glibc-2.33, but check it for musl
['mallinfo2', '''#include <malloc.h>'''], # since glibc-2.33
['execveat', '''#include <unistd.h>'''], # since glibc-2.34
['close_range', '''#include <unistd.h>'''], # since glibc-2.34