diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-24 15:25:33 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-09-06 10:52:19 +0200 |
commit | da15db787bffe90e8ea8baac6a0cf6153922d088 (patch) | |
tree | 09c1a0393d630a9bd1f84e2d982d5c7aaa7e9277 /cpukit/score/src | |
parent | score: Add _RBTree_Initialize_one() (diff) | |
download | rtems-da15db787bffe90e8ea8baac6a0cf6153922d088.tar.bz2 |
score: Improve red-black tree debug support
Ensure that we extract a node only from the right tree.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r-- | cpukit/score/src/rbtreeextract.c | 5 | ||||
-rw-r--r-- | cpukit/score/src/rbtreeinsert.c | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/cpukit/score/src/rbtreeextract.c b/cpukit/score/src/rbtreeextract.c index 3905f64900..8a87b2d56c 100644 --- a/cpukit/score/src/rbtreeextract.c +++ b/cpukit/score/src/rbtreeextract.c @@ -21,8 +21,7 @@ void _RBTree_Extract( RBTree_Node *the_node ) { + _Assert( the_node->tree == the_rbtree ); RB_REMOVE( RBTree_Control, the_rbtree, the_node ); -#if defined(RTEMS_DEBUG) - _RBTree_Set_off_tree( the_node ); -#endif + _RBTree_Initialize_node( the_node ); } diff --git a/cpukit/score/src/rbtreeinsert.c b/cpukit/score/src/rbtreeinsert.c index c8bbef9aad..99dc2a233f 100644 --- a/cpukit/score/src/rbtreeinsert.c +++ b/cpukit/score/src/rbtreeinsert.c @@ -19,5 +19,9 @@ void _RBTree_Insert_color( RBTree_Node *the_node ) { +#if defined(RTEMS_DEBUG) + _Assert( the_node->tree == NULL ); + the_node->tree = the_rbtree; +#endif RBTree_Control_RB_INSERT_COLOR( the_rbtree, the_node ); } |