mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-23 19:30:26 +08:00
score: Add red-black tree append/prepend
These functions are a faster alternative to _RBTree_Insert_inline() if it is known that the new node is the maximum/minimum node. Update #4531.
This commit is contained in:
@@ -30,6 +30,32 @@ extern "C" {
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Appends the node to the red-black tree.
|
||||
*
|
||||
* The appended node is the new maximum node of the tree. The caller shall
|
||||
* ensure that the appended node is indeed the maximum node with respect to the
|
||||
* tree order.
|
||||
*
|
||||
* @param[in, out] the_rbtree is the red-black tree control.
|
||||
*
|
||||
* @param the_node[out] is the node to append.
|
||||
*/
|
||||
void _RBTree_Append( RBTree_Control *the_rbtree, RBTree_Node *the_node );
|
||||
|
||||
/**
|
||||
* @brief Prepends the node to the red-black tree.
|
||||
*
|
||||
* The prepended node is the new minimum node of the tree. The caller shall
|
||||
* ensure that the prepended node is indeed the minimum node with respect to the
|
||||
* tree order.
|
||||
*
|
||||
* @param[in, out] the_rbtree is the red-black tree control.
|
||||
*
|
||||
* @param the_node[out] is the node to prepend.
|
||||
*/
|
||||
void _RBTree_Prepend( RBTree_Control *the_rbtree, RBTree_Node *the_node );
|
||||
|
||||
/**
|
||||
* @brief Red-black tree visitor.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user