summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--radsecproxy.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e5df020..4c500e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Copyright (c) 2006-2010, UNINETT AS
-dnl Copyright (c) 2010-2012, NORDUnet A/S
+dnl Copyright (c) 2010-2013, NORDUnet A/S
dnl See LICENSE for licensing information.
AC_INIT(radsecproxy, 1.7-dev, radsecproxy@uninett.no)
@@ -7,6 +7,8 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_PROG_RANLIB
+AC_CHECK_FUNCS([mallopt])
+
udp=yes
AC_ARG_ENABLE(udp,
[ --enable-udp whether to enable UDP transport: yes/no; default yes ],
diff --git a/radsecproxy.c b/radsecproxy.c
index d2f72b0..caec987 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -39,6 +39,9 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
+#if defined(HAVE_MALLOPT)
+#include <malloc.h>
+#endif
#ifdef SYS_SOLARIS9
#include <fcntl.h>
#endif
@@ -3335,6 +3338,10 @@ int radsecproxy_main(int argc, char **argv) {
debugx(1, DBG_ERR, "pthread_attr_init failed");
if (pthread_attr_setstacksize(&pthread_attr, PTHREAD_STACK_SIZE))
debugx(1, DBG_ERR, "pthread_attr_setstacksize failed");
+#if defined(HAVE_MALLOPT)
+ if (mallopt(M_TRIM_THRESHOLD, 4 * 1024) != 1)
+ debugx(1, DBG_ERR, "mallopt failed");
+#endif
for (i = 0; i < RAD_PROTOCOUNT; i++)
protodefs[i] = protoinits[i](i);