5
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2010 Gedare Bloom. |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.org/license/LICENSE. |
---|
7 | */ |
---|
8 | |
---|
9 | #if HAVE_CONFIG_H |
---|
10 | #include "config.h" |
---|
11 | #endif |
---|
12 | |
---|
13 | #include <rtems/score/rbtreeimpl.h> |
---|
14 | |
---|
15 | RB_GENERATE_REMOVE_COLOR( RBTree_Control, RBTree_Node, Node, static ) |
---|
16 | |
---|
17 | RB_GENERATE_REMOVE( RBTree_Control, RBTree_Node, Node, static ) |
---|
18 | |
---|
19 | #if defined(RTEMS_DEBUG) |
---|
20 | static const RBTree_Node *_RBTree_Find_root( const RBTree_Node *the_node ) |
---|
21 | { |
---|
22 | while ( true ) { |
---|
23 | const RBTree_Node *potential_root; |
---|
24 | |
---|
25 | potential_root = the_node; |
---|
26 | the_node = _RBTree_Parent( the_node ); |
---|
27 | |
---|
28 | if ( the_node == NULL ) { |
---|
29 | return potential_root; |
---|
30 | } |
---|
31 | } |
---|
32 | } |
---|
33 | #endif |
---|
34 | |
---|
35 | void _RBTree_Extract( |
---|
36 | RBTree_Control *the_rbtree, |
---|
37 | RBTree_Node *the_node |
---|
38 | ) |
---|
39 | { |
---|
40 | _Assert( _RBTree_Find_root( the_node ) == _RBTree_Root( the_rbtree ) ); |
---|
41 | RB_REMOVE( RBTree_Control, the_rbtree, the_node ); |
---|
42 | _RBTree_Initialize_node( the_node ); |
---|
43 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.