Changeset 21275b58 in rtems for cpukit/score/src/objectfree.c


Ignore:
Timestamp:
Nov 22, 2018, 6:14:51 PM (11 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
6b0a729b
Parents:
0f5b2c09
git-author:
Sebastian Huber <sebastian.huber@…> (11/22/18 18:14:51)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/14/18 06:03:29)
Message:

score: Static Objects_Information initialization

Statically allocate the objects information together with the initial
set of objects either via <rtems/confdefs.h>. Provide default object
informations with zero objects via librtemscpu.a. This greatly
simplifies the workspace size estimate. RTEMS applications which do not
use the unlimited objects option are easier to debug since all objects
reside now in statically allocated objects of the right types.

Close #3621.

File:
1 edited

Legend:

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

    r0f5b2c09 r21275b58  
    3939    objects_per_block = information->objects_per_block;
    4040    block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM;
    41     block /= objects_per_block;
    4241
    43     ++information->inactive_per_block[ block ];
     42    if ( block > objects_per_block ) {
     43      block /= objects_per_block;
    4444
    45     inactive = information->inactive;
    46     ++inactive;
    47     information->inactive = inactive;
     45      ++information->inactive_per_block[ block ];
    4846
    49     /*
    50      *  Check if the threshold level has been met of
    51      *  1.5 x objects_per_block are free.
    52      */
     47      inactive = information->inactive;
     48      ++inactive;
     49      information->inactive = inactive;
    5350
    54     if ( inactive > ( objects_per_block + ( objects_per_block >> 1 ) ) ) {
    55       _Objects_Shrink_information( information );
     51      /*
     52       *  Check if the threshold level has been met of
     53       *  1.5 x objects_per_block are free.
     54       */
     55
     56      if ( inactive > ( objects_per_block + ( objects_per_block >> 1 ) ) ) {
     57        _Objects_Shrink_information( information );
     58      }
    5659    }
    5760  }
Note: See TracChangeset for help on using the changeset viewer.