summaryrefslogtreecommitdiffstats
path: root/cpukit/include
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-22 07:31:46 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-23 11:00:28 +0100
commit577262a73757a1d1561935f4efebfd39e333391a (patch)
tree9696529924a20b3300f9db48d0d64ef276bdefdd /cpukit/include
parentscore: Simplify _Scheduler_Generic_block() (diff)
downloadrtems-577262a73757a1d1561935f4efebfd39e333391a.tar.bz2
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.
Diffstat (limited to 'cpukit/include')
-rw-r--r--cpukit/include/rtems/score/rbtreeimpl.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/cpukit/include/rtems/score/rbtreeimpl.h b/cpukit/include/rtems/score/rbtreeimpl.h
index 597c24d771..0867240d59 100644
--- a/cpukit/include/rtems/score/rbtreeimpl.h
+++ b/cpukit/include/rtems/score/rbtreeimpl.h
@@ -31,6 +31,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.
*
* @param[in] node The node.