diff --git a/src/common/autoconfig.h.in b/src/common/autoconfig.h.in index c6dc665a..e46b702e 100644 --- a/src/common/autoconfig.h.in +++ b/src/common/autoconfig.h.in @@ -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 header file. */ #undef HAVE_MEMORY_H diff --git a/src/configure.ac b/src/configure.ac index 85c6ca73..e47eecae 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -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, diff --git a/src/internfile/mh_xslt.cpp b/src/internfile/mh_xslt.cpp index 3b80fa2c..26a02782 100644 --- a/src/internfile/mh_xslt.cpp +++ b/src/internfile/mh_xslt.cpp @@ -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 */ } }