it corrupts active chains and can change the data at a node which
someone might be using. (In the latter case, though the full name from
the root was still intact, and the ->data member was not altered, other
values like the partial name ndata and offsets could change.)
New functions dns_rbt_fullnamefromnode() and dns_rbt_formatnodename(),
for getting a dns_name_t and filling a char buffer, respectively, with
the complete name of a node from the root.
rbtnode.is_root was being treated as isc_boolean_t even though it was bitfield
of width 1. This worked fine, but wasn't consistent with ISC style, and
would have puked if someone decided to change isc_true from 1 (unlikely
as that is). Yeah, anal, I know.
rather than the hash of the partial name stored in the node. This more
evenly distributes nodes across locks.
This change only takes effect when DNS_RBT_USEHASH is defined, and also changes
the rbt so that the hashtable is created when the first node is created in the
tree, not after 64 nodes are added.
information can be discerned via node parent pointers.
533. [func] Incorporated name hashing into the RBT database to
improve search speed.
There is still evidence of a bug with regard to bitstring labels. It shows
up in bin/test/rbt/t_rbt -x -t 4 when the assertion at lib/dns/rbt.c:1631
is uncommented -- essentially a bitstring node's location in the hashtable
is not getting properly updated at some point. This shouldn't affect
searching, because a bitstring label as the parent of a new level will
generally cause the standard old binary search to be done. I will be looking
at this more closely in the very near future.
origin for a node that stores the root label
the name is now set to an empty name, instead of ".",
to simplify later use of the name and origin by
dns_name_concatenate(), dns_name_totext() or
dns_name_format().
360. [func] dns_name_totext() and dns_name_format() now allow
an empty name to be passed, which is formatted as "@".
of dns_name_concatenate(NULL, NULL, name, NULL).
Define DNS_NAME_USELINE to get macroized name functions. Removed
older FAST_COUNTLABELS and FAST_ISABSOLUTE to use standard name
interface, which are covered by DNS_NAME_USEINLINE.
match does not have associated data and DNS_RBTFIND_EMPTYDATA is not set.
Return DNS_R_PARTIALMATCH instead if there is a superdomain with
data, or ISC_R_NOTFOUND if no superdomain has data.
Make dns_rbt_findname() honor DNS_RBTFIND_EMPTYDATA, per the rbt.h
documentation that has been saying it will. It didn't.
defined, as it is by default now. huge performance hit that we would
likely have been slow to notice if not for the t_rbt chain tests
having a bug. :-)
should have been set to NULL when the top of a level was being rotated but
instead it was set to the node which pointed down to the level of the deleted
node.
rotate_left and rotate_right no longer take a parent parameter, since they
don't need it with the existence of parent pointers.
dns_rbt_deletefromlevel now takes a pointer to the pointer of the root of
the level as a parameter so that it doesn't have to rediscover the root that
its caller (dns_rbt_deletenode) already discovered.
dns_rbt_deletefromlevel did some (minor) pointless work with the sibling of the
deleted node before the color fixup loop was entered; it does so no more.
forward function declarations changed to ISC style.
Cleanup of redundant/useless header file inclusion.
ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
/*
* This is a comment.
*/
Added:
isc_buffer_base(b) (pointer)
isc_buffer_current(b) (pointer)
isc_buffer_active(b) (pointer)
isc_buffer_used(b) (pointer)
isc_buffer_length(b) (int)
isc_buffer_usedlength(b) (int)
isc_buffer_consumedlength(b) (int)
isc_buffer_remaininglength(b) (int)
isc_buffer_activelength(b) (int)
isc_buffer_availablelength(b) (int)
Removed:
ISC_BUFFER_USEDCOUNT(b)
ISC_BUFFER_AVAILABLECOUNT(b)
isc_buffer_type(b)
Changed names:
isc_buffer_used(b, r) ->
isc_buffer_usedregion(b, r)
isc_buffer_available(b, r) ->
isc_buffer_available_region(b, r)
isc_buffer_consumed(b, r) ->
isc_buffer_consumedregion(b, r)
isc_buffer_active(b, r) ->
isc_buffer_activeregion(b, r)
isc_buffer_remaining(b, r) ->
isc_buffer_remainingregion(b, r)
Buffer types were removed, so the ISC_BUFFERTYPE_*
macros are no more, and the type argument to
isc_buffer_init and isc_buffer_allocate were removed.
isc_buffer_putstr is now void (instead of isc_result_t)
and requires that the caller ensure that there
is enough available buffer space for the string.
of dns_rbt_findnode should be skipped. Nothing external uses it yet, but
when the chain option is NULL, this option is set internally as predecessor
searching is irrelevant. (It was skipped before now, but via a different
mechanism.)
Add DNS_RBTFIND_NOOPTIONS to make it clear what the options parameter of
dns_rbt_find* is when no options are passed, and use it in dns_rbt_deletename.
REQUIRE that DNS_RBTFIND_NOEXACT and DNS_RBTFIND_NOPREDECESSOR are mutually
exclusive to dns_rbt_findnode.
deletion bug fixed that could orphan a large section of the tree. the
"parent" argument to rotate_left or rotate_right was sometimes not
really the parent of the rotation vertex, because the parent's parent
was not correctly reidentified after a rotation done on the parent.
Minor:
forward static declaration of dns_rbt_printnodename, useful in debugging.
level_matches set correctly for exact match in dns_rbt_findnode (it was
one too few, but this was minor because as yet level_matches is only
used by other code when a partial match was made.
insist 'node' is a child of 'parent' in rotate_left and rotate_right
compare a pointer explicitly to NULL that was just "if (pointer)"
"would would" in a comment changed to just one "would".