Explicitly test for malloc_trim() in configure
This commit is contained in:
parent
38dfa5f841
commit
25a5f3a7e0
@ -45,6 +45,9 @@
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the `malloc_trim' function. */
|
||||
#undef HAVE_MALLOC_TRIM
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ AC_SYS_LARGEFILE
|
||||
# OpenBSD needs sys/param.h for mount.h to compile
|
||||
AC_CHECK_HEADERS([sys/param.h, spawn.h])
|
||||
|
||||
AC_CHECK_FUNCS([posix_spawn setrlimit kqueue vsnprintf])
|
||||
AC_CHECK_FUNCS([posix_spawn setrlimit kqueue vsnprintf malloc_trim])
|
||||
|
||||
if test "x$ac_cv_func_posix_spawn" = xyes; then :
|
||||
AC_ARG_ENABLE(posix_spawn,
|
||||
|
||||
@ -52,9 +52,9 @@ public:
|
||||
// malloc_trim() and mallopt() doc seems to be a bit
|
||||
// misleading, there is probably a frag size under which
|
||||
// free() does not try to malloc_trim() at all
|
||||
#ifndef _WIN32
|
||||
#ifdef HAVE_MALLOC_TRIM
|
||||
malloc_trim(0);
|
||||
#endif
|
||||
#endif /* HAVE_MALLOC_TRIM */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user