]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
--enable-alloc-nonregional
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 11 Mar 2010 09:35:08 +0000 (09:35 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 11 Mar 2010 09:35:08 +0000 (09:35 +0000)
git-svn-id: file:///svn/unbound/trunk@2022 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
doc/Changelog
util/regional.c

index 99f8cbc6da17f9eea23123a5cc16f5976d62627e..c522663ee45d79e5c97797836ae16e582eba9f74 100644 (file)
 /* use to enable lightweight alloc assertions, for debug use */
 #undef UNBOUND_ALLOC_LITE
 
+/* use malloc not regions, for debug use */
+#undef UNBOUND_ALLOC_NONREGIONAL
+
 /* use statistics for allocs and frees, for debug use */
 #undef UNBOUND_ALLOC_STATS
 
index 81e21a87ea9b33092befd541b185ae022db81daf..a9f411fd6287ba1d6219ce9cd2ba914fb5265e8a 100755 (executable)
--- a/configure
+++ b/configure
@@ -933,6 +933,7 @@ enable_staticexe
 enable_lock_checks
 enable_alloc_checks
 enable_alloc_lite
+enable_alloc_nonregional
 enable_largefile
 with_ldns
 with_ldns_builtin
@@ -1592,6 +1593,10 @@ Optional Features:
                           purposes
   --enable-alloc-lite     enable for lightweight alloc assertions, for debug
                           purposes
+  --enable-alloc-nonregional
+                          enable nonregional allocs, slow but exposes regional
+                          allocations to other memory purifiers, for debug
+                          purposes
   --disable-largefile     omit support for large files
 
 Optional Packages:
@@ -7293,13 +7298,13 @@ if test "${lt_cv_nm_interface+set}" = set; then
 else
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:7296: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:7301: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:7299: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:7304: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:7302: output\"" >&5)
+  (eval echo "\"\$as_me:7307: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
     lt_cv_nm_interface="MS dumpbin"
@@ -8504,7 +8509,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 8507 "configure"' > conftest.$ac_ext
+  echo '#line 8512 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9871,11 +9876,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9874: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9879: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9878: \$? = $ac_status" >&5
+   echo "$as_me:9883: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -10210,11 +10215,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10213: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10218: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:10217: \$? = $ac_status" >&5
+   echo "$as_me:10222: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -10315,11 +10320,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10318: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10323: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10322: \$? = $ac_status" >&5
+   echo "$as_me:10327: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -10370,11 +10375,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10373: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10378: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10377: \$? = $ac_status" >&5
+   echo "$as_me:10382: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13173,7 +13178,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13176 "configure"
+#line 13181 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -13269,7 +13274,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 13272 "configure"
+#line 13277 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19273,6 +19278,18 @@ if test "${enable_alloc_lite+set}" = set; then
   enableval=$enable_alloc_lite;
 fi
 
+# Check whether --enable-alloc-nonregional was given.
+if test "${enable_alloc_nonregional+set}" = set; then
+  enableval=$enable_alloc_nonregional;
+fi
+
+if test x_$enable_alloc_nonregional = x_yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define UNBOUND_ALLOC_NONREGIONAL 1
+_ACEOF
+
+fi
 if test x_$enable_alloc_checks = x_yes; then
 
 cat >>confdefs.h <<\_ACEOF
index 9ade3efb68e5166a31452095fb9b2e02b43053ad..f40bb11ffed4aa7b8ce3fd6f916b71a061b910a6 100644 (file)
@@ -521,6 +521,12 @@ AC_ARG_ENABLE(alloc-checks, AC_HELP_STRING([--enable-alloc-checks],
 AC_ARG_ENABLE(alloc-lite, AC_HELP_STRING([--enable-alloc-lite],
        [ enable for lightweight alloc assertions, for debug purposes ]), 
        , )
+AC_ARG_ENABLE(alloc-nonregional, AC_HELP_STRING([--enable-alloc-nonregional],
+       [ enable nonregional allocs, slow but exposes regional allocations to other memory purifiers, for debug purposes ]), 
+       , )
+if test x_$enable_alloc_nonregional = x_yes; then
+       AC_DEFINE(UNBOUND_ALLOC_NONREGIONAL, 1, [use malloc not regions, for debug use])
+fi
 if test x_$enable_alloc_checks = x_yes; then
        AC_DEFINE(UNBOUND_ALLOC_STATS, 1, [use statistics for allocs and frees, for debug use])
 else
index fe1eb95d9a19f67d627a5edf16796ed25cf280ad..8977b2cb4dc7cd0dacdb63c07214347d95ef0ef2 100644 (file)
@@ -1,3 +1,7 @@
+11 March 2010: Wouter
+       - another memory allocation option: --enable-alloc-nonregional.
+         exposes the regional allocations to other memory purifiers.
+
 10 March 2010: Wouter
        - --enable-alloc-lite works with test set.
        - portability in the testset: printf format conversions, prototypes.
index b314c2937fb24ed9c2ca52ffe7b5f436223da603..37f243909fdd40f05d680e35d8afebb73e0793ac 100644 (file)
 
 /** Default reasonable size for chunks */
 #define REGIONAL_CHUNK_SIZE         8192
+#ifdef UNBOUND_ALLOC_NONREGIONAL
+/** All objects allocated outside of chunks, for debug */
+#define REGIONAL_LARGE_OBJECT_SIZE  0
+#else
 /** Default size for large objects - allocated outside of chunks. */
 #define REGIONAL_LARGE_OBJECT_SIZE  2048
+#endif
 
 struct regional* 
 regional_create()