]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
The blst_radix_init function has two purposes - to compute the number of
authorAlan Cox <alc@FreeBSD.org>
Sun, 8 Oct 2017 22:17:39 +0000 (22:17 +0000)
committerAlan Cox <alc@FreeBSD.org>
Sun, 8 Oct 2017 22:17:39 +0000 (22:17 +0000)
commit8eefcd407b8f1d44c3062cfefdeed166d3b8154f
tree5debc8f341796d1c54cac5b19d6763af351680ec
parent7e7ef416327c7672478f02348d65c00d7f99929c
The blst_radix_init function has two purposes - to compute the number of
nodes to allocate for the blist, and to initialize them.  The computation
can be done much more quickly by identifying the terminating node, if any,
at every level of the tree and then summing the number of nodes at each
level that precedes the topmost terminator.  The initialization can also be
done quickly, since settings at the root mark the tree as all-allocated, and
only a few terminator nodes need to be marked in the rest of the tree.
Eliminate blst_radix_init, and perform its two functions more simply in
blist_create.

The allocation of the blist takes places in two pieces, but there's no good
reason to do so, when a single allocation is sufficient, and simpler.
Allocate the blist struct, and the array of nodes associated with it, with a
single allocation.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj (an earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D11968
sys/kern/subr_blist.c
sys/sys/blist.h