Changeset da15db78 in rtems


Ignore:
Timestamp:
Aug 24, 2016, 1:25:33 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
3709987
Parents:
83b0229
git-author:
Sebastian Huber <sebastian.huber@…> (08/24/16 13:25:33)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/06/16 08:52:19)
Message:

score: Improve red-black tree debug support

Ensure that we extract a node only from the right tree.

Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/jffs2/include/linux/rbtree.h

    r83b0229 rda15db78  
    2323  struct rb_node *rb_parent;
    2424  int rb_color;
     25#if defined(RTEMS_DEBUG)
     26  const RBTree_Control *rb_tree;
     27#endif
    2528};
    2629
  • cpukit/score/include/rtems/score/rbtree.h

    r83b0229 rda15db78  
    4040/**@{*/
    4141
     42struct RBTree_Control;
     43
    4244/**
    4345 * @brief Red-black tree node.
     
    4850typedef struct RBTree_Node {
    4951  RB_ENTRY(RBTree_Node) Node;
     52#if defined(RTEMS_DEBUG)
     53  const struct RBTree_Control *tree;
     54#endif
    5055} RBTree_Node;
    5156
     
    125130#if defined(RTEMS_DEBUG)
    126131  _RBTree_Set_off_tree( the_node );
     132  the_node->tree = NULL;
    127133#endif
    128134}
     
    401407{
    402408  _Assert( _RBTree_Is_node_off_tree( the_node ) );
     409#if defined(RTEMS_DEBUG)
     410  _Assert( the_node->tree == NULL );
     411  the_node->tree = the_rbtree;
     412#endif
    403413  RB_ROOT( the_rbtree ) = the_node;
    404414  RB_PARENT( the_node, Node ) = NULL;
  • cpukit/score/src/rbtreeextract.c

    r83b0229 rda15db78  
    2222)
    2323{
     24  _Assert( the_node->tree == the_rbtree );
    2425  RB_REMOVE( RBTree_Control, the_rbtree, the_node );
    25 #if defined(RTEMS_DEBUG)
    26   _RBTree_Set_off_tree( the_node );
    27 #endif
     26  _RBTree_Initialize_node( the_node );
    2827}
  • cpukit/score/src/rbtreeinsert.c

    r83b0229 rda15db78  
    2020)
    2121{
     22#if defined(RTEMS_DEBUG)
     23  _Assert( the_node->tree == NULL );
     24  the_node->tree = the_rbtree;
     25#endif
    2226  RBTree_Control_RB_INSERT_COLOR( the_rbtree, the_node );
    2327}
Note: See TracChangeset for help on using the changeset viewer.