From d36024cdb8a42bdc81f3ab0df2559f1efe9d46b5 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 20 Jun 2022 17:51:46 -0700 Subject: [PATCH] ircd::allocator: Support mallinfo2() for deprecated mallinfo(3) for GNU allocator. --- configure.ac | 2 ++ ircd/allocator_gnu.cc | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index fd4b940bb..a811138ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1272,6 +1272,8 @@ AC_CHECK_FUNCS([ \ backtrace \ fadvise \ madvise \ + mallinfo \ + mallinfo2 \ mlock \ mlock2 \ mmap \ diff --git a/ircd/allocator_gnu.cc b/ircd/allocator_gnu.cc index a79a7c563..68494daff 100644 --- a/ircd/allocator_gnu.cc +++ b/ircd/allocator_gnu.cc @@ -47,7 +47,13 @@ ircd::allocator::info(const mutable_buffer &buf, const auto ma { - ::mallinfo() + #if defined(HAVE_MALLINFO2) + ::mallinfo2() + #elif defined(HAVE_MALLINFO) + ::mallinfo2() + #else + #error "Missing mallinfo(3)." + #endif }; char pbuf[96];