summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h.cmake1
-rw-r--r--configure.cmake1
-rw-r--r--sql/sql_test.cc8
3 files changed, 8 insertions, 2 deletions
diff --git a/config.h.cmake b/config.h.cmake
index 0e19dd44694..c74592b4a65 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -177,6 +177,7 @@
#cmakedefine HAVE_DECL_MADVISE 1
#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA 1
#cmakedefine HAVE_MALLINFO 1
+#cmakedefine HAVE_MALLINFO2 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
#cmakedefine HAVE_MKSTEMP 1
diff --git a/configure.cmake b/configure.cmake
index 58e1111bfc7..1aa0827a503 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -358,6 +358,7 @@ CHECK_FUNCTION_EXISTS (localtime_r HAVE_LOCALTIME_R)
CHECK_FUNCTION_EXISTS (lstat HAVE_LSTAT)
CHECK_FUNCTION_EXISTS (madvise HAVE_MADVISE)
CHECK_FUNCTION_EXISTS (mallinfo HAVE_MALLINFO)
+CHECK_FUNCTION_EXISTS (mallinfo2 HAVE_MALLINFO2)
CHECK_FUNCTION_EXISTS (memcpy HAVE_MEMCPY)
CHECK_FUNCTION_EXISTS (memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS (mkstemp HAVE_MKSTEMP)
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\