]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGRECORD
authorOndřej Surý <ondrej@sury.org>
Tue, 11 May 2021 10:59:35 +0000 (12:59 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 9 Jul 2021 13:58:02 +0000 (15:58 +0200)
The ISC_MEM_DEBUGSIZE and ISC_MEM_DEBUGCTX did sanity checks on matching
size and memory context on the memory returned to the allocator.  Those
will no longer needed when most of the allocator will be replaced with
jemalloc.

48 files changed:
bin/check/named-checkconf.c
bin/dnssec/dnssec-keygen.c
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssec-verify.c
bin/named/main.c
bin/tests/system/README
bin/tests/system/additional/ns1/named.args
bin/tests/system/allow-query/ns3/named.args
bin/tests/system/cacheclean/ns1/named.args
bin/tests/system/cacheclean/ns2/named.args
bin/tests/system/delzone/ns2/named.args
bin/tests/system/dnssec/ns6/named.args
bin/tests/system/dnstap/ns3/named.args
bin/tests/system/dscp/ns1/named.args
bin/tests/system/dscp/ns2/named.args
bin/tests/system/dscp/ns3/named.args
bin/tests/system/dscp/ns4/named.args
bin/tests/system/dscp/ns5/named.args
bin/tests/system/dscp/ns6/named.args
bin/tests/system/dscp/ns7/named.args
bin/tests/system/dupsigs/ns1/named.args
bin/tests/system/fetchlimit/ns3/named.args
bin/tests/system/legacy/ns4/named.args
bin/tests/system/legacy/ns5/named.args
bin/tests/system/legacy/ns6/named.args
bin/tests/system/legacy/ns7/named.args
bin/tests/system/logfileconfig/tests.sh
bin/tests/system/mirror/ns3/named.args
bin/tests/system/mkeys/ns2/named.args
bin/tests/system/mkeys/ns3/named.args
bin/tests/system/mkeys/ns5/named1.args
bin/tests/system/mkeys/ns5/named2.args
bin/tests/system/mkeys/ns6/named.args
bin/tests/system/nsupdate/ns5/named.args
bin/tests/system/nsupdate/ns6/named.args
bin/tests/system/resolver/tests.sh
bin/tests/system/rpzextra/ns1/named.args
bin/tests/system/runtime/tests.sh
bin/tests/system/start.pl
bin/tests/system/timeouts/ns1/named.args
bin/tests/system/zero/ns2/named.args
bin/tests/system/zero/ns3/named.args
bin/tests/system/zero/ns4/named.args
bin/tests/wire_test.c
lib/isc/include/isc/mem.h
lib/isc/mem.c
lib/isc/tls.c
lib/isc/trampoline.c

index 11303e964870e7817f81f54432aaaec37f282292..d1f4e037d31c675a46839fc6c0f7d2e233e8241c 100644 (file)
@@ -611,12 +611,6 @@ main(int argc, char **argv) {
                        {
                                isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
                        }
-                       if (strcasecmp(isc_commandline_argument, "size") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
-                       }
-                       if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGCTX;
-                       }
                        break;
                default:
                        break;
index 349aa00f43c4483dab0fe3064c5a4d8f3aeb5fdb..c9bf49f4fe7b7212a4620a7a178d4044f55533ba 100644 (file)
@@ -909,12 +909,6 @@ main(int argc, char **argv) {
                        {
                                isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
                        }
-                       if (strcasecmp(isc_commandline_argument, "size") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
-                       }
-                       if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGCTX;
-                       }
                        break;
                default:
                        break;
index 4329fe7f0a2f06692c35e20ec47cbfae2c2053a4..e321295684d6b70882541f0e2852f1a0a8855124 100644 (file)
@@ -3335,12 +3335,6 @@ main(int argc, char *argv[]) {
                        {
                                isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
                        }
-                       if (strcasecmp(isc_commandline_argument, "size") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
-                       }
-                       if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGCTX;
-                       }
                        break;
                default:
                        break;
index eb845ffbc89736e10de09442c4c30165723a0d6f..a5ed08742fe4200454daf14a84b9240939c4951e 100644 (file)
@@ -209,12 +209,6 @@ main(int argc, char *argv[]) {
                        {
                                isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
                        }
-                       if (strcasecmp(isc_commandline_argument, "size") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
-                       }
-                       if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGCTX;
-                       }
                        break;
                default:
                        break;
index 9fc84deef130fb8b6df6ad97b5af6e438814c7b3..565246d77230f7c5164029bf710c1961869b965d 100644 (file)
@@ -430,8 +430,6 @@ static struct flag_def {
                        { "trace", ISC_MEM_DEBUGTRACE, false },
                        { "record", ISC_MEM_DEBUGRECORD, false },
                        { "usage", ISC_MEM_DEBUGUSAGE, false },
-                       { "size", ISC_MEM_DEBUGSIZE, false },
-                       { "mctx", ISC_MEM_DEBUGCTX, false },
                        { NULL, 0, false } },
   mem_context_flags[] = { { "fill", ISC_MEMFLAG_FILL, false },
                          { "nofill", ISC_MEMFLAG_FILL, true },
index c0970ebd3255154b81e65c7aea8a5a7a861b2106..f24bd0365ec897d06c5ac6c5bd1bb036bafef79a 100644 (file)
@@ -546,7 +546,7 @@ By default, start.pl starts a "named" server with the following options:
     -g              Runs the server in the foreground and logs everything to
                     stderr.
 
-    -m record,size,mctx
+    -m record
                     Turns on these memory usage debugging flags.
 
     -U 4            Uses four listeners.
index 15aa849355f51f605d8bae3fe3457d42b2c8a788..45ac93a7c78aaa58923be1f567129f17508d0f12 100644 (file)
@@ -1,2 +1,2 @@
 # this server runs named with only one worker thread
--m record,size,mctx -c named.conf -d 99 -D additional-ns1 -X named.lock -g -n 1 -T maxcachesize=2097152
+-m record -c named.conf -d 99 -D additional-ns1 -X named.lock -g -n 1 -T maxcachesize=2097152
index 35e99d8dd8b83bae82c6674fa3e3a9bbafba69f8..e875a57bc7f3fa79ad7f5a90f2df83c0d6eccabe 100644 (file)
@@ -1,2 +1,2 @@
 # this server only has 127.0.0.1 in its localhost/localnets ACLs
--m record,size,mctx -c named.conf -d 99 -D allow-query-ns3 -X named.lock -g -T maxcachesize=2097152 -T fixedlocal
+-m record -c named.conf -d 99 -D allow-query-ns3 -X named.lock -g -T maxcachesize=2097152 -T fixedlocal
index 2ba9a1403d3ce72dc680409e1aa20dc687227dd1..b7ce00d2b70720c4899216094f4d74893bf4d0b5 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 1 -D cacheclean-ns1 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 1 -D cacheclean-ns1 -X named.lock -g -T maxcachesize=2097152
index 1bcc5eab2820b4b143213387ea18bb26937ae3d7..071016c00b3a5eca332da077401260feb69d5ec4 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 3 -D cacheclean-ns2 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 3 -D cacheclean-ns2 -X named.lock -g -T maxcachesize=2097152
index be9241ed54a57318b95163bd26be557dc52117ee..6ee0d9fe9a14905a5b146b1e03c0c7b68393dc79 100644 (file)
@@ -1 +1 @@
--D delzone-ns2 -X named.lock -m record,size,mctx -c named.conf -g -U 4 -T maxcachesize=2097152
+-D delzone-ns2 -X named.lock -m record -c named.conf -g -U 4 -T maxcachesize=2097152
index 65b7dbcc939dea21fc58ddf36a2dcd72d8b9eb66..4b96405caaa6c03f42d39dfee0ae37b1a7400071 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dnssec-ns6 -X named.lock -g -T maxcachesize=2097152 -T nonearest -T tat=1
+-m record -c named.conf -d 99 -D dnssec-ns6 -X named.lock -g -T maxcachesize=2097152 -T nonearest -T tat=1
index fb42af211a05f54fe644fda9a42e537ad27a20fa..7937dee5fb8136d020e64f5ef6121a42c86e599d 100644 (file)
@@ -1,2 +1,2 @@
 # Using "-n 1" allows GL #1795 to be reliably reproduced
--D dnstap-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -n 1 -T maxcachesize=2097152
+-D dnstap-ns3 -X named.lock -m record -c named.conf -d 99 -g -U 4 -n 1 -T maxcachesize=2097152
index 0c955c704a14c38bc3d6e34785720f4545720d6f..2a3e86a26df03d331f99ef5c6e0567a14025816e 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns1 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns1 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index ff501a812c06ce212c39f758b43f6c974ce7925f..7122b39537429f106f8ca6499402abeaada51d39 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns2 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns2 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index 3d1981fb59adc3a24e1c459cdc761742ca3dca13..60ae7f4f9193bef7d10087e7b3f6939e5ae81ca7 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns3 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns3 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index 277a47b628f10819e6b24b41f93abb96e90b505c..8352455c096aa5b8904fc643d7b62aea55952b72 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index c678163f374a13d47c98d5b3189d4037f3f502db..4f0c842128a0806f3dcc47fd6376a532c6b93c0b 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index 283cf22011b6f5f0498f36040c3db0488e65e916..a5a278df095d36da87d3ff110b3cd51641970476 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index 4ccf38ea05cd768a919c454cf468c7caa563f600..733a65e4f7522d280e49cb35630f86156855b031 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D dscp-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
+-m record -c named.conf -d 99 -D dscp-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T dscp=46
index 231eed49024514df3185c462c16060c7c90f8d71..adf6968f869eef22fa4c187c9306f4735ee05a05 100644 (file)
@@ -1 +1 @@
--D dupsigs-ns1 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T sigvalinsecs
+-D dupsigs-ns1 -X named.lock -m record -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T sigvalinsecs
index 6bd3e6cf64b19f54d44c80322cd9d573cf1e5efb..d3488cefe1799821f73c059cd8302fd54ac2e023 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 1 -D fetchlimit-ns3 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 1 -D fetchlimit-ns3 -X named.lock -g -T maxcachesize=2097152
index 0fe677432954551344e799351473cd1d515371f5..4ccb6485956f327e8fc68b914d354c52acf3fc90 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D legacy-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns
+-m record -c named.conf -d 99 -D legacy-ns4 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns
index 364370a18b4d7748e0bb22623745cfbbaca2c41a..0c5e17a9408ff59f29dcce2b3329d673da20e888 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D legacy-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns
+-m record -c named.conf -d 99 -D legacy-ns5 -X named.lock -g -U 4 -T maxcachesize=2097152 -T noedns
index 64e5524324a8e8ab5fc7046963aef61b741c0947..3475121784424fbbc1c4e2c067fa899fae0652c7 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D legacy-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512
+-m record -c named.conf -d 99 -D legacy-ns6 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512
index e491a95dc6113f81045c9e2101db1ecfe1a81179..1da498080fd26996390ef1d8b2c1ecaa79d6f04a 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D legacy-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512
+-m record -c named.conf -d 99 -D legacy-ns7 -X named.lock -g -U 4 -T maxcachesize=2097152 -T maxudp512
index e1d26a7d29c72250ad7f5e9158fddf314bf93394..191680873ed2b4c764d7c8af3e7e0f085ad1fb36 100644 (file)
@@ -35,7 +35,7 @@ DLFILE="named_deflog"
 
 PIDFILE="${THISDIR}/${CONFDIR}/named.pid"
 myRNDC="$RNDC -c ${THISDIR}/${CONFDIR}/rndc.conf"
-myNAMED="$NAMED -c ${THISDIR}/${CONFDIR}/named.conf -m record,size,mctx -T nosyslog -d 99 -D logfileconfig-ns1 -X named.lock -U 4"
+myNAMED="$NAMED -c ${THISDIR}/${CONFDIR}/named.conf -m record -T nosyslog -d 99 -D logfileconfig-ns1 -X named.lock -U 4"
 
 # Test given condition.  If true, test again after a second.  Used for testing
 # filesystem-dependent conditions in order to prevent false negatives caused by
index 7519c8f587b0ec2a12c553053a8ccd606260abdb..78f3feba8f2d55d7745cb8421c266b031c313550 100644 (file)
@@ -1 +1 @@
--D mirror-ns3 -X named.lock -m record,size,mctx -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T tat=3
+-D mirror-ns3 -X named.lock -m record -c named.conf -d 99 -g -U 4 -T maxcachesize=2097152 -T tat=3
index 2f752bd79b012decbc524c8f674499a08f056619..e588c91b48849915249e1e18b59c9d92c58e0e9f 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D mkeys-ns2 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 -T tat=1
+-m record -c named.conf -d 99 -D mkeys-ns2 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20 -T tat=1
index 2015ee509a7475c902e1c724043b2506b2847fa6..28396c356c6a93ff504905d1d5815cdce24ec052 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -D mkeys-ns3 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20
+-m record -c named.conf -d 99 -D mkeys-ns3 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20
index c4c8a55817365ff60676f152595a9bf3472deda5..6eeaa290063e19d872153e1cf010216aa166c985 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152
index 3fd830afbbe0c5e40c74d56d16f7bc7e958a2767..34ac30d93797c4fc963d85833fcd7f1d5d8443bd 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=2/20/40
+-m record -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=2/20/40
index 65a8fcaa974225f0e959c4ab4a58eed76885fdef..7ef5cf02f981df73d5d06fc32f17509f5de530cb 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20
+-m record -c named.conf -d 99 -X named.lock -g -T maxcachesize=2097152 -T mkeytimers=5/10/20
index a1ebb6f7631678fe11358677de46e8469a82c397..fc5a5cd2a76bd6a6cd298456f0077314e8533bb6 100644 (file)
@@ -1 +1 @@
--D nsupdate-ns5 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal
+-D nsupdate-ns5 -m record -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal
index 11e544952626f17a39bdfb681e3619b18b3746be..48e2bd82c694bf3fc9b90a2c85b206ca81951cdb 100644 (file)
@@ -1 +1 @@
--D nsupdate-ns6 -m record,size,mctx -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal
+-D nsupdate-ns6 -m record -c named.conf -d 99 -X named.lock -g -U 4 -T maxcachesize=2097152 -T fixedlocal
index a958103c0a1eccf440b2a76dd94fd719aea92e56..435501c2a4c3c2683ca5e459025a55a8857f8d68 100755 (executable)
@@ -833,7 +833,7 @@ status=`expr $status + $ret`
 n=`expr $n + 1`
 echo_i "check logged command line ($n)"
 ret=0
-grep "running as: .* -m record,size,mctx " ns1/named.run > /dev/null || ret=1
+grep "running as: .* -m record " ns1/named.run > /dev/null || ret=1
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
index b289924b274877b2e1472a4e6fd070686ac2749e..970fc226396a13e90d836614ab494c88abf60834 100644 (file)
@@ -1 +1 @@
- -m record,size,mctx -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -T maxcachesize=2097152
+ -m record -c named.conf -d 99 -D rpzextra-ns1 -X named.lock -U 4 -T maxcachesize=2097152
index 5cc11015a09734246a3d9c7138041daf2d83a085..ddbdc10a800bec3768cc18c37c368db8eae3e474 100644 (file)
@@ -15,7 +15,7 @@
 set -e
 
 RNDCCMD="$RNDC -c ../common/rndc.conf -p ${CONTROLPORT} -s"
-NAMED_DEFAULT_ARGS="-m record,size,mctx -d 99 -g -U 4"
+NAMED_DEFAULT_ARGS="-m record -d 99 -g -U 4"
 
 kill_named() {
        pidfile="${1}"
index 89807d0cd0bd46413e30b10cc06a91a6d7eda3a7..307fd25d5ffc456b2088f5456cd3b4f1494b4d42 100755 (executable)
@@ -267,7 +267,7 @@ sub construct_ns_command {
        } else {
                $command .= "-D $test-$server ";
                $command .= "-X named.lock ";
-               $command .= "-m record,size,mctx ";
+               $command .= "-m record ";
 
                foreach my $t_option(
                        "dropedns", "ednsformerr", "ednsnotimp", "ednsrefused",
index 2df2be27372fabb5e7aa365610801e3fbc2f9cd9..437a77f0f4a4673d07e4c538d94f2d37258d8a6f 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 1 -D timeouts-ns1 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 1 -D timeouts-ns1 -X named.lock -g -T maxcachesize=2097152
index b20594ea45c27a8a0003fdfc26ac7593762e13a0..4b7aad606a2395ecf1945b1652929f3d89d88098 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 1 -D zero-ns2 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 1 -D zero-ns2 -X named.lock -g -T maxcachesize=2097152
index 9d89bd697ca8674a04636d3fc5269a6001a2c65d..e6f6060089d9e60b09faa69204664da2f89aacee 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 1 -D zero-ns3 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 1 -D zero-ns3 -X named.lock -g -T maxcachesize=2097152
index 09d1fe01fc57204cc2b85d4fd0908f4be5ca2524..bd59f13b6c8b5639e97d1992ac4cf8ff293e22ac 100644 (file)
@@ -1 +1 @@
--m record,size,mctx -c named.conf -d 1 -D zero-ns4 -X named.lock -g -T maxcachesize=2097152
+-m record -c named.conf -d 1 -D zero-ns4 -X named.lock -g -T maxcachesize=2097152
index ef86a1e7c561a1f5b0d535da4094035330daef07..7b290f8cd97a5316adaf6eb1075ac0b29d1d6a86 100644 (file)
@@ -130,12 +130,6 @@ main(int argc, char *argv[]) {
                        {
                                isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
                        }
-                       if (strcasecmp(isc_commandline_argument, "size") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGSIZE;
-                       }
-                       if (strcasecmp(isc_commandline_argument, "mctx") == 0) {
-                               isc_mem_debugging |= ISC_MEM_DEBUGCTX;
-                       }
                        break;
                default:
                        break;
index a5f003bdced43e0f700d53241461e028d1555cb8..945151e0f290440d32f62590ea326be8da2369d6 100644 (file)
@@ -43,8 +43,6 @@ extern unsigned int isc_mem_defaultflags;
 #define ISC_MEM_DEBUGTRACE  0x00000001U
 #define ISC_MEM_DEBUGRECORD 0x00000002U
 #define ISC_MEM_DEBUGUSAGE  0x00000004U
-#define ISC_MEM_DEBUGSIZE   0x00000008U
-#define ISC_MEM_DEBUGCTX    0x00000010U
 #define ISC_MEM_DEBUGALL    0x0000001FU
 /*!<
  * The variable isc_mem_debugging holds a set of flags for
@@ -63,14 +61,6 @@ extern unsigned int isc_mem_defaultflags;
  * \li #ISC_MEM_DEBUGUSAGE
  *     If a hi_water mark is set, print the maximum inuse memory
  *     every time it is raised once it exceeds the hi_water mark.
- *
- * \li #ISC_MEM_DEBUGSIZE
- *     Check the size argument being passed to isc_mem_put() matches
- *     that passed to isc_mem_get().
- *
- * \li #ISC_MEM_DEBUGCTX
- *     Check the mctx argument being passed to isc_mem_put() matches
- *     that passed to isc_mem_get().
  */
 /*@}*/
 
index 70dae2c471e0560864cdb35a0f089c2da226724b..12a866e07a8ca6c358d0648324082d9539b65c23 100644 (file)
@@ -604,28 +604,11 @@ isc__mem_putanddetach(isc_mem_t **ctxp, void *ptr, size_t size FLARG) {
        isc_mem_t *ctx = *ctxp;
        *ctxp = NULL;
 
-       if (ISC_UNLIKELY((isc_mem_debugging &
-                         (ISC_MEM_DEBUGSIZE | ISC_MEM_DEBUGCTX)) != 0))
-       {
-               if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) {
-                       size_info *si = &(((size_info *)ptr)[-1]);
-                       size_t oldsize = si->size - ALIGNMENT_SIZE;
-                       if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) {
-                               oldsize -= ALIGNMENT_SIZE;
-                       }
-                       INSIST(oldsize == size);
-               }
-               isc__mem_free(ctx, ptr FLARG_PASS);
-
-               goto destroy;
-       }
-
        DELETE_TRACE(ctx, ptr, size, file, line);
 
        mem_putstats(ctx, ptr, size);
        mem_put(ctx, ptr, size);
 
-destroy:
        if (isc_refcount_decrement(&ctx->references) == 1) {
                isc_refcount_destroy(&ctx->references);
                destroy(ctx);
@@ -717,12 +700,6 @@ isc__mem_get(isc_mem_t *ctx, size_t size FLARG) {
        void *ptr;
        bool call_water = false;
 
-       if (ISC_UNLIKELY((isc_mem_debugging &
-                         (ISC_MEM_DEBUGSIZE | ISC_MEM_DEBUGCTX)) != 0))
-       {
-               return (isc__mem_allocate(ctx, size FLARG_PASS));
-       }
-
        ptr = mem_get(ctx, size);
        mem_getstats(ctx, size);
 
@@ -743,23 +720,6 @@ isc__mem_put(isc_mem_t *ctx, void *ptr, size_t size FLARG) {
        REQUIRE(ptr != NULL);
 
        bool call_water = false;
-       size_info *si;
-
-       if (ISC_UNLIKELY((isc_mem_debugging &
-                         (ISC_MEM_DEBUGSIZE | ISC_MEM_DEBUGCTX)) != 0))
-       {
-               if ((isc_mem_debugging & ISC_MEM_DEBUGSIZE) != 0) {
-                       size_t oldsize;
-                       si = &(((size_info *)ptr)[-1]);
-                       oldsize = si->size - ALIGNMENT_SIZE;
-                       if ((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0) {
-                               oldsize -= ALIGNMENT_SIZE;
-                       }
-                       INSIST(oldsize == size);
-               }
-               isc__mem_free(ctx, ptr FLARG_PASS);
-               return;
-       }
 
        DELETE_TRACE(ctx, ptr, size, file, line);
 
@@ -894,16 +854,9 @@ mem_allocateunlocked(isc_mem_t *ctx, size_t size) {
        size_info *si;
 
        size += ALIGNMENT_SIZE;
-       if (ISC_UNLIKELY((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)) {
-               size += ALIGNMENT_SIZE;
-       }
 
        si = mem_get(ctx, size);
 
-       if (ISC_UNLIKELY((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)) {
-               si->ctx = ctx;
-               si++;
-       }
        si->size = size;
        return (&si[1]);
 }
@@ -955,11 +908,6 @@ isc__mem_reallocate(isc_mem_t *ctx, void *ptr, size_t size FLARG) {
                        oldsize = (((size_info *)ptr)[-1]).size;
                        INSIST(oldsize >= ALIGNMENT_SIZE);
                        oldsize -= ALIGNMENT_SIZE;
-                       if (ISC_UNLIKELY((isc_mem_debugging &
-                                         ISC_MEM_DEBUGCTX) != 0)) {
-                               INSIST(oldsize >= ALIGNMENT_SIZE);
-                               oldsize -= ALIGNMENT_SIZE;
-                       }
                        copysize = (oldsize > size) ? size : oldsize;
                        memmove(new_ptr, ptr, copysize);
                        isc__mem_free(ctx, ptr FLARG_PASS);
@@ -980,14 +928,8 @@ isc__mem_free(isc_mem_t *ctx, void *ptr FLARG) {
        size_t size;
        bool call_water = false;
 
-       if (ISC_UNLIKELY((isc_mem_debugging & ISC_MEM_DEBUGCTX) != 0)) {
-               si = &(((size_info *)ptr)[-2]);
-               REQUIRE(si->ctx == ctx);
-               size = si[1].size;
-       } else {
-               si = &(((size_info *)ptr)[-1]);
-               size = si->size;
-       }
+       si = &(((size_info *)ptr)[-1]);
+       size = si->size;
 
        DELETE_TRACE(ctx, ptr, size, file, line);
 
index cf947fa645a856d05c3eeb35536f399c42e69cdd..ad0cb74168bdfb3e7a79188adc4da79e6502cd74 100644 (file)
@@ -72,11 +72,7 @@ tls_initialize(void) {
        /*
         * We can't use isc_mem API here, because it's called too
         * early and when the isc_mem_debugging flags are changed
-        * later and ISC_MEM_DEBUGSIZE or ISC_MEM_DEBUGCTX flags are
-        * added, neither isc_mem_put() nor isc_mem_free() can be used
-        * to free up the memory allocated here because the flags were
-        * not set when calling isc_mem_get() or isc_mem_allocate()
-        * here.
+        * later.
         *
         * Actually, since this is a single allocation at library load
         * and deallocation at library unload, using the standard
index 009e8d136b0df0d15ee25fa1f309de12bf697235..5d0429dfe954b504eba0cea46ccbe38599dcd74c 100644 (file)
@@ -40,17 +40,13 @@ static size_t isc__trampoline_min = 1;
 static size_t isc__trampoline_max = 65;
 
 /*
- * We can't use isc_mem API here, because it's called too
- * early and when the isc_mem_debugging flags are changed
- * later and ISC_MEM_DEBUGSIZE or ISC_MEM_DEBUGCTX flags are
- * added, neither isc_mem_put() nor isc_mem_free() can be used
- * to free up the memory allocated here because the flags were
- * not set when calling isc_mem_get() or isc_mem_allocate()
- * here.
+ * We can't use isc_mem API here, because it's called too early and the
+ * isc_mem_debugging flags can be changed later causing mismatch between flags
+ * used for isc_mem_get() and isc_mem_put().
  *
- * Actually, since this is a single allocation at library load
- * and deallocation at library unload, using the standard
- * allocator without the tracking is fine for this purpose.
+ * Since this is a single allocation at library load and deallocation at library
+ * unload, using the standard allocator without the tracking is fine for this
+ * single purpose.
  */
 static isc__trampoline_t *
 isc__trampoline_new(int tid, isc_threadfunc_t start, isc_threadarg_t arg) {