Changeset bc93f30f in rtems


Ignore:
Timestamp:
Jul 7, 2009, 10:47:03 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
d6c8b56b
Parents:
33a5381
Message:

2009-07-07 Chris Johns <chrisj@…>

  • score/src/objectshrinkinformation.c: Rework loop to simplify and remove dead code.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r33a5381 rbc93f30f  
     12009-07-07      Chris Johns <chrisj@rtems.org>
     2
     3        * score/src/objectshrinkinformation.c: Rework loop to simplify and
     4        remove dead code.
     5
    162009-07-07      Joel Sherrill <joel.sherrill@OARcorp.com>
    27
  • cpukit/score/src/objectshrinkinformation.c

    r33a5381 rbc93f30f  
    6060
    6161  index_base = _Objects_Get_index( information->minimum_id );
    62   block_count = ( information->maximum - index_base ) / information->allocation_size;
     62  block_count = (information->maximum - index_base) /
     63                 information->allocation_size;
    6364
    6465  for ( block = 0; block < block_count; block++ ) {
    65     if ( information->inactive_per_block[ block ] == information->allocation_size ) {
    66 
    67       /*
    68        * XXX - Not to sure how to use a chain where you need to iterate and
    69        *       and remove elements.
    70        */
    71 
    72       the_object = (Objects_Control *) information->Inactive.first;
     66    if ( information->inactive_per_block[ block ] ==
     67         information->allocation_size ) {
    7368
    7469      /*
    7570       *  Assume the Inactive chain is never empty at this point
    7671       */
     72      the_object = (Objects_Control *) information->Inactive.first;
    7773
    7874      do {
    79         index = _Objects_Get_index( the_object->id );
    80 
    81         if ((index >= index_base) &&
    82             (index < (index_base + information->allocation_size))) {
    83 
    84           /*
    85            *  Get the next node before the node is extracted
    86            */
    87 
    88           extract_me = the_object;
    89 
    90           if ( !_Chain_Is_last( &the_object->Node ) )
    91             the_object = (Objects_Control *) the_object->Node.next;
    92           else
    93             the_object = NULL;
    94 
    95           _Chain_Extract( &extract_me->Node );
    96         }
    97         else {
    98           the_object = (Objects_Control *) the_object->Node.next;
    99         }
    100       }
    101       while ( the_object && !_Chain_Is_last( &the_object->Node ) );
    102 
     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 );
    10387      /*
    10488       *  Free the memory and reset the structures in the object' information
Note: See TracChangeset for help on using the changeset viewer.