# Checks for system library functions
#--------------------------------------------------------------------------
-check_function_exists(mallinfo HAVE_MALLINFO)
check_function_exists(malloc_trim HAVE_MALLOC_TRIM)
check_function_exists(memrchr HAVE_MEMRCHR)
check_function_exists(sigaction HAVE_SIGACTION)
/* Availability of specific library functions */
-/* Define to 1 if you have the `mallinfo' function. */
-#cmakedefine HAVE_MALLINFO 1
-
/* Define to 1 if you have the `malloc_trim' function. */
#cmakedefine HAVE_MALLOC_TRIM 1
#include <fcntl.h>
-#if defined(HAVE_MALLINFO) || defined(HAVE_MALLOC_TRIM)
+#if defined(HAVE_MALLOC_TRIM)
#include <malloc.h>
#endif
malloc_trim(0);
#endif
}
-
-void log_malloc_info()
-{
-#ifdef HAVE_MALLINFO
- struct mallinfo mi = mallinfo();
-
- LogLabel("heap usage");
- LogCount("total non-mmapped bytes", mi.arena);
- LogCount("bytes in mapped regions", mi.hblkhd);
- LogCount("total allocated space", mi.uordblks);
- LogCount("total free space", mi.fordblks);
- LogCount("topmost releasable block", mi.keepcost);
-
-#ifdef DEBUG
- LogCount("free chunks", mi.ordblks);
- LogCount("free fastbin blocks", mi.smblks);
- LogCount("mapped regions", mi.hblks);
- LogCount("max total alloc space", mi.usmblks);
- LogCount("free bytes in fastbins", mi.fsmblks);
-#endif
-#endif
-}
-
LogLabel("Summary Statistics");
show_stats((PegCount*)&proc_stats, proc_names, array_size(proc_names)-1, "process");
- if ( SnortConfig::log_verbose() )
- log_malloc_info();
}
//-------------------------------------------------------------------------