BIND 10 #2105: introduce node deleter of new RBTree
BIND 10 Development
do-not-reply at isc.org
Thu Jul 26 07:48:55 UTC 2012
#2105: introduce node deleter of new RBTree
-------------------------------------+-------------------------------------
Reporter: | Owner:
jinmei | Status: new
Type: task | Milestone:
Priority: | Sprint-20120731
medium | Resolution:
Component: data | Sensitive: 0
source | Sub-Project: DNS
Keywords: | Estimated Difficulty: 4
Defect Severity: N/A | Total Hours: 0
Feature Depending on Ticket: |
scalable inmemory |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Description changed by jinmei:
Old description:
> We are not going to store node data in the new RBTree in the form
> of shared pointers, so the tree needs to take care of destroying
> node data when it destructs the entire tree.
>
> My suggestion is to make it a template parameter and call its
> operator() via the destructor.
>
> {{{#!cpp
> template <typename T, typename DeleterType>
> class RBTree : public boost::noncopyable {
> ...
> template <typename T, typename DeleterType>
> RBTree<T>::~RBTree() {
> DeleterType deleter;
> deleteHelper(root_, segment_, deleter);
> assert(node_count_ == 0);
> }
> }}}
>
> This depends on at least #2088 and #2090.
New description:
We are not going to store node data in the new RBTree in the form
of shared pointers, so the tree needs to take care of destroying
node data when it destructs the entire tree.
My suggestion is to make it a template parameter and call its
operator() via the destructor.
{{{#!cpp
template <typename T, typename DeleterType>
class RBTree : public boost::noncopyable {
...
template <typename T, typename DeleterType>
RBTree<T>::~RBTree() {
DeleterType deleter;
deleteHelper(root_, segment_, deleter);
assert(node_count_ == 0);
}
}}}
This depends on at least #2088 and #2090.
It'd also be better to hold off until #2091 is merged (or work on a
snapshot version of trac2091b).
Also, I guess this is the time to fork from the currently used version
of the code; beyond this point I suspect it won't be feasible to share
the same code base for the shared_ptr version and offset_ptr version.
So I propose making a copy of rbtree.h, moving it to datasrc/memory
with a copy of the test (and maybe rename the class to e.g.
`DomainTree`), and working on the copy version.
--
--
Ticket URL: <http://bind10.isc.org/ticket/2105#comment:4>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list