Commit 6729dd89 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.5 into 10.6

parents d2e2d329 8d472f2b
......@@ -92,6 +92,7 @@ SET(HAVE_MADVISE CACHE INTERNAL "")
SET(HAVE_MALLINFO CACHE INTERNAL "")
SET(HAVE_MALLINFO2 CACHE INTERNAL "")
SET(HAVE_MALLOC_H 1 CACHE INTERNAL "")
SET(HAVE_MALLOC_ZONE CACHE INTERNAL "")
SET(HAVE_MEMALIGN CACHE INTERNAL "")
SET(HAVE_MEMCPY 1 CACHE INTERNAL "")
SET(HAVE_MEMMOVE 1 CACHE INTERNAL "")
......
......@@ -171,6 +171,7 @@
#cmakedefine HAVE_DECL_MHA_MAPSIZE_VA 1
#cmakedefine HAVE_MALLINFO 1
#cmakedefine HAVE_MALLINFO2 1
#cmakedefine HAVE_MALLOC_ZONE 1
#cmakedefine HAVE_MEMCPY 1
#cmakedefine HAVE_MEMMOVE 1
#cmakedefine HAVE_MKSTEMP 1
......
......@@ -364,6 +364,7 @@ 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 (malloc_zone_statistics HAVE_MALLOC_ZONE)
CHECK_FUNCTION_EXISTS (memcpy HAVE_MEMCPY)
CHECK_FUNCTION_EXISTS (memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS (mkstemp HAVE_MKSTEMP)
......
......@@ -33,6 +33,8 @@
#include <malloc.h>
#elif defined(HAVE_MALLINFO) && defined(HAVE_SYS_MALLOC_H)
#include <sys/malloc.h>
#elif defined(HAVE_MALLOC_ZONE)
#include <malloc/malloc.h>
#endif
#ifdef HAVE_EVENT_SCHEDULER
......@@ -655,6 +657,20 @@ Memory allocated by threads: %s\n",
llstr(tmp.global_memory_used, llbuff[8]),
llstr(tmp.local_memory_used, llbuff[9]));
#elif defined(HAVE_MALLOC_ZONE)
malloc_statistics_t info;
char llbuff[4][22];
malloc_zone_statistics(nullptr, &info);
printf("\nMemory status:\n\
Total allocated space: %s\n\
Total free space: %s\n\
Global memory allocated by server: %s\n\
Memory allocated by threads: %s\n",
llstr(info.size_allocated, llbuff[0]),
llstr((info.size_allocated - info.size_in_use), llbuff[1]),
llstr(tmp.global_memory_used, llbuff[2]),
llstr(tmp.local_memory_used, llbuff[3]));
#endif
#ifdef HAVE_EVENT_SCHEDULER
......
......@@ -321,8 +321,8 @@ rec_init_offsets_comp_ordinary(
ordinary:
lens = --nulls - n_core_null_bytes;
ut_d(n_null = std::min(n_core_null_bytes * 8U,
index->n_nullable));
ut_d(n_null = std::min<uint>(n_core_null_bytes * 8U,
index->n_nullable));
break;
case REC_LEAF_INSTANT:
nulls -= REC_N_NEW_EXTRA_BYTES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment