1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

15 Commits

Author SHA1 Message Date
Joe Thornber
4d964133e2 [radix-tree] alternative radix-tree implementation.
Sacrifices performance for simplicity, meant only for verification of
the real adaptive implementation.
2018-09-11 13:12:07 +01:00
Joe Thornber
8b05f1f230 radix-tree: Fix bug in remove_prefix()
Accidental decrement of the nr entries when a n256 didn't have the
entry in the first place.
2018-08-20 15:23:40 +01:00
Joe Thornber
254e5c5d11 radix-tree: squash a pointer arithmetic warning 2018-06-21 17:41:56 +01:00
Joe Thornber
72e2e92f4c radix-tree: fix bug when erasing elts in remove_prefix
_erase_elt() now zeroes the last element of the array (ie. sets to
UNSET).  Previously remove() was doing this, but not remove_prefix().
2018-06-21 17:10:05 +01:00
Joe Thornber
40c1f7889f radix-tree: More debugging of remove
There's now a pretty printer called radix_tree_dump()

n4, n16, and n48 weren't UNSETting the last entry after
sliding values down.
2018-06-21 09:49:43 +01:00
Joe Thornber
20b9746c5d radix-tree: FIx various bugs to do with removal
Add radix_tree_is_well_formed() which does some sanity checking
of the tree.

Call the above a lot in the unit tests.

Fix revealed bugs.
2018-06-21 09:49:08 +01:00
Joe Thornber
06c789eda1 radix-tree: fix some bugs in remove_prefix and iterate
These weren't working if the prefix key was part of a prefix_chain.
2018-05-30 14:21:27 +01:00
Joe Thornber
1924426ad1 radix-tree: radix_tree_iterate() 2018-05-29 17:58:58 +01:00
Joe Thornber
c2a8bbed3b radix-tree: radix_tree_remove_prefix() 2018-05-29 13:25:59 +01:00
Joe Thornber
9b41efae82 radix-tree: call the value dtr when removing an entry. 2018-05-29 11:23:36 +01:00
Joe Thornber
0181c77e3f Merge branch '2018-05-29-radix-tree-iterate' into 2018-05-23-radix-tree-remove 2018-05-29 11:04:32 +01:00
Joe Thornber
033df741e2 data-struct/radix-tree: pass the value dtr into create.
Rather than having to pass it into every method that removes items.
2018-05-29 11:03:10 +01:00
Joe Thornber
b7fd8ac8eb radix_tree: add remove method 2018-05-23 12:48:06 +01:00
Joe Thornber
30a4c7988e radix-tree: remove some unneccessary includes 2018-05-11 09:46:34 +01:00
Joe Thornber
576dd1fc41 radix-tree: First drop of radix tree.
An implementation of an adaptive radix tree.  Has the following nice
properties:

  - At least as fast as the hash table
  - Uses less memory
  - You don't need to give an expected size when you create
  - It scales nicely (ie. no large reallocations like the hash table).
  - You can iterate the keys in lexicographical order.

Only insert and lookup are implemented so far.  Plus there's a lot
more performance to come.
2018-05-11 06:10:01 +01:00