summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMichael Okoko <okokomichaels@outlook.com>2021-03-26 20:48:59 +0100
committerDaniel Black <daniel@mariadb.org>2021-03-27 08:40:04 +1100
commit48141f3c1787de941d969ad1e6675611b2b650c2 (patch)
treebbe16ae19778a3ebf56d683ebf49c88845d45471 /sql
parent36a05268e7059163752ab91d1cbe1180dbd90b93 (diff)
downloadmariadb-git-48141f3c1787de941d969ad1e6675611b2b650c2.tar.gz
Replace mallinfo with mallinfo2 on supported systems
`mallinfo` is deprecated since glibc 2.33 and has been replaced by mallinfo2. The deprecation causes building the server to fail if glibc version is > 2.33. Check if mallinfo2 exist on the system and use it instead.
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_test.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index c0e62227665..d877eb21588 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -616,8 +616,12 @@ Next alarm time: %lu\n",
(ulong)alarm_info.next_alarm_time);
#endif
display_table_locks();
-#ifdef HAVE_MALLINFO
- struct mallinfo info= mallinfo();
+#if defined(HAVE_MALLINFO2)
+ struct mallinfo2 info = mallinfo2();
+#elif defined(HAVE_MALLINFO)
+ struct mallinfo info= mallinfo();
+#endif
+#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)
char llbuff[10][22];
printf("\nMemory status:\n\
Non-mmapped space allocated from system: %s\n\