Check for availability of mallinfo()
Fixes the build on FreeBSD. Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
parent
8da5c5f50e
commit
68bc5baf12
@ -104,6 +104,7 @@ AC_SUBST(GJS_JS_NATIVE_DIR)
|
||||
AC_SUBST(GJS_CONSOLE)
|
||||
|
||||
AC_CHECK_FUNCS(fdwalk)
|
||||
AC_CHECK_FUNCS(mallinfo)
|
||||
AC_CHECK_HEADERS([sys/resource.h])
|
||||
|
||||
# Sets GLIB_GENMARSHAL and GLIB_MKENUMS
|
||||
|
@ -38,7 +38,9 @@
|
||||
#include <gjs/gjs.h>
|
||||
#include <girepository.h>
|
||||
#include <gmodule.h>
|
||||
#ifdef HAVE_MALLINFO
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -246,6 +248,7 @@ static void
|
||||
malloc_statistics_callback (ShellPerfLog *perf_log,
|
||||
gpointer data)
|
||||
{
|
||||
#ifdef HAVE_MALLINFO
|
||||
struct mallinfo info = mallinfo ();
|
||||
|
||||
shell_perf_log_update_statistic_i (perf_log,
|
||||
@ -257,6 +260,7 @@ malloc_statistics_callback (ShellPerfLog *perf_log,
|
||||
shell_perf_log_update_statistic_i (perf_log,
|
||||
"malloc.usedSize",
|
||||
info.uordblks);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user