core: btree: implement moving btree nodes
moving a btree node is similar to simply using memmove() or memcpy(), with the added bonus of updating the pointers in the wider data structure to the new node memory and zeroing the old node memory so that it isn't used accidentally after the move is complete.
This commit is contained in:
@@ -335,6 +335,8 @@ static inline b_btree_node *b_btree_parent(b_btree_node *node)
|
||||
return node->b_parent;
|
||||
}
|
||||
|
||||
BLUE_API void b_btree_move(b_btree *tree, b_btree_node *dest, b_btree_node *src);
|
||||
|
||||
/* get the height of `node`.
|
||||
|
||||
the height of a node is defined as the length of the longest path
|
||||
|
||||
Reference in New Issue
Block a user