Changeset 8949e5b in rtems


Ignore:
Timestamp:
Jan 3, 2013, 4:07:14 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10
Children:
833eeae
Parents:
39691cd
git-author:
Sebastian Huber <sebastian.huber@…> (01/03/13 16:07:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/07/13 15:34:18)
Message:

score: Fix _Objects_Shrink_information()

The chain iteration was wrong. The chain tail is not an object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/objectshrinkinformation.c

    r39691cd r8949e5b  
    4848)
    4949{
    50   Objects_Control  *the_object;
    51   Objects_Control  *extract_me;
    5250  uint32_t          block_count;
    5351  uint32_t          block;
    5452  uint32_t          index_base;
    55   uint32_t          index;
    5653
    5754  /*
     
    6663    if ( information->inactive_per_block[ block ] ==
    6764         information->allocation_size ) {
     65      Chain_Node       *node = _Chain_First( &information->Inactive );
     66      const Chain_Node *tail = _Chain_Tail( &information->Inactive );
     67      uint32_t          index_end = index_base + information->allocation_size;
    6868
    69       /*
    70        *  Assume the Inactive chain is never empty at this point
    71        */
    72       the_object = (Objects_Control *) information->Inactive.first;
     69      while ( node != tail ) {
     70        Objects_Control *object = (Objects_Control *) node;
     71        uint32_t         index = _Objects_Get_index( object->id );
    7372
    74       do {
    75          index = _Objects_Get_index( the_object->id );
    76          /*
    77           *  Get the next node before the node is extracted
    78           */
    79          extract_me = the_object;
    80          the_object = (Objects_Control *) the_object->Node.next;
    81          if ((index >= index_base) &&
    82              (index < (index_base + information->allocation_size))) {
    83            _Chain_Extract( &extract_me->Node );
    84          }
    85        }
    86        while ( the_object );
     73        /*
     74         *  Get the next node before the node is extracted
     75         */
     76        node = _Chain_Next( node );
     77
     78        if ( index >= index_base && index < index_end ) {
     79          _Chain_Extract( &object->Node );
     80        }
     81      }
     82
    8783      /*
    8884       *  Free the memory and reset the structures in the object' information
Note: See TracChangeset for help on using the changeset viewer.