BIND 10 trac2091b, updated. 1ee0d41198397e9772d7b833231c96dae50f944f [2091b] cleanup: removed a leftover comment line
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Jul 25 17:28:07 UTC 2012
The branch, trac2091b has been updated
via 1ee0d41198397e9772d7b833231c96dae50f944f (commit)
via 98181a847e71f8a502f5614158bf2ade6dd8fc5f (commit)
via 69fd22252b4e4850e8adc767848d997901023d39 (commit)
via a79037eb4aee4116ffe8a3b980cfad2d6a625803 (commit)
from 90e3121ad4b59d78682b9aad79da414c5fbda374 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 1ee0d41198397e9772d7b833231c96dae50f944f
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jul 25 10:27:31 2012 -0700
[2091b] cleanup: removed a leftover comment line
commit 98181a847e71f8a502f5614158bf2ade6dd8fc5f
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jul 25 10:26:21 2012 -0700
[2091b] simplified bitfield swap
commit 69fd22252b4e4850e8adc767848d997901023d39
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jul 25 10:15:43 2012 -0700
[2091b] more comment clarifications.
commit a79037eb4aee4116ffe8a3b980cfad2d6a625803
Author: JINMEI Tatuya <jinmei at isc.org>
Date: Wed Jul 25 09:28:58 2012 -0700
[2091b] doxygen comment wording fix.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/rbtree.h | 27 ++++++++++++++++-----------
src/lib/datasrc/tests/rbtree_unittest.cc | 1 -
2 files changed, 16 insertions(+), 12 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/rbtree.h b/src/lib/datasrc/rbtree.h
index b87d25a..ab6523b 100644
--- a/src/lib/datasrc/rbtree.h
+++ b/src/lib/datasrc/rbtree.h
@@ -71,8 +71,8 @@ class RBTree;
/// the node color) are encoded as part of "flags", some of the flag bits
/// can also be set by the user application. Each node is associated with
/// a sequence of domain name labels, which is essentially the search/insert
-/// key for the noce (see also the description of RBTree). This is encoded
-/// as opaque binary immediately followed by the main node object. The size
+/// key for the node (see also the description of RBTree). This is encoded
+/// as opaque binary immediately following the main node object. The size
/// of the allocated space for the labels data is encoded by borrowing some
/// bits of the "flags" field.
template <typename T>
@@ -205,6 +205,13 @@ public:
///
/// To get the absolute name of one node, the node path from the top node
/// to current node has to be recorded.
+ ///
+ /// \note We should eventually deprecate this method and revise all its
+ /// usage with \c getLabels(). At this point the only user of this method
+ /// is getAbsoluteName()::getAbsoluteName(), which would have to be revised
+ /// using \c LabelSequence. Until then we keep this interface as a
+ /// simplest form of wrapper; it's not efficient, but should be replaced
+ /// before we need to worry about that.
const isc::dns::Name getName() const {
assert(labels_capacity_ != 0); // shouldn't be called on a NULL node.
return (dns::Name(dns::LabelSequence(getLabelsData()).toText()));
@@ -1614,6 +1621,7 @@ RBTree<T>::deleteAllNodes(util::MemorySegment& mem_sgmt) {
// change this part so the newly created node will be used for the inserted
// name (and therefore the name for the existing node doesn't change).
// Otherwise, things like shortcut links between nodes won't work.
+// See Trac #2054.
template <typename T>
void
RBTree<T>::nodeFission(util::MemorySegment& mem_sgmt, RBNode<T>& node,
@@ -1630,16 +1638,13 @@ RBTree<T>::nodeFission(util::MemorySegment& mem_sgmt, RBNode<T>& node,
std::swap(node.data_, down_node->data_);
- // Swap flags bitfields; yes, this is ugly. The right solution is to
- // implement the above note, then we won't have to swap the flags in the
- // first place.
- struct {
- uint32_t flags_ : 23;
- uint32_t unused_ : 9;
- } tmp;
- tmp.flags_ = node.flags_;
+ // Swap flags bitfields; yes, this is ugly (it appears we cannot use
+ // std::swap for bitfields). The right solution is to implement
+ // the above note regarding #2054, then we won't have to swap the
+ // flags in the first place.
+ const uint32_t tmp = node.flags_;
node.flags_ = down_node->flags_;
- down_node->flags_ = tmp.flags_;
+ down_node->flags_ = tmp;
down_node->down_ = node.getDown();
node.down_ = down_node;
diff --git a/src/lib/datasrc/tests/rbtree_unittest.cc b/src/lib/datasrc/tests/rbtree_unittest.cc
index f45e08e..cb55d81 100644
--- a/src/lib/datasrc/tests/rbtree_unittest.cc
+++ b/src/lib/datasrc/tests/rbtree_unittest.cc
@@ -748,7 +748,6 @@ TEST_F(RBTreeTest, getLastComparedNode) {
tree.find(Name("bb"), &crbtnode, chain));
EXPECT_EQ(expected_node, chain.getLastComparedNode());
// bb < c, no common label
- //comparisonChecks(chain, -1, 1, NameComparisonResult::COMMONANCESTOR);
comparisonChecks(chain, -1, 0, NameComparisonResult::NONE);
chain.clear();
More information about the bind10-changes
mailing list