Changeset f0bf3326 in rtems


Ignore:
Timestamp:
Aug 6, 2009, 8:43:19 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
ac893a9
Parents:
e41a748
Message:

Revert.

File:
1 edited

Legend:

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

    re41a748 rf0bf3326  
    5454  uint32_t          minimum_index;
    5555  uint32_t          index;
    56   void             *new_object_block;
    5756
    5857  /*
     
    7877  }
    7978
    80   /*
    81    * Allocate the name table, and the objects and if it fails either return or
    82    * generate a fatal error depending on auto-extending being active.
    83    */
    84  
    85   new_object_block =
    86     _Workspace_Allocate(
    87       (information->allocation_size * information->size)
    88     );
    89  
    90   if ( new_object_block == NULL ) {
    91     if ( information->auto_extend ) {
    92       return;
    93     }
    94     else {
    95       _Internal_error_Occurred(
    96         INTERNAL_ERROR_CORE,
    97         true,
    98         INTERNAL_ERROR_WORKSPACE_ALLOCATION
    99       );
    100     }
    101   }
    102  
    10379  /*
    10480   *  If the index_base is the maximum we need to grow the tables.
     
    137113    block_count++;
    138114
    139     maximum = (uint32_t) information->maximum + information->allocation_size;
     115    maximum = information->maximum + information->allocation_size;
    140116
    141117    /*
     
    144120     *  case of 16-bit Ids, this is only 256 object instances.
    145121     */
    146     if ( maximum > OBJECTS_ID_FINAL_INDEX ) {
    147       if ( !_Workspace_Free( new_object_block ) ) {
    148         _Internal_error_Occurred(
    149           INTERNAL_ERROR_CORE,
    150           true,
    151           INTERNAL_ERROR_WORKSPACE_ALLOCATION
    152         );
    153       }
     122    if ( maximum > OBJECTS_ID_FINAL_INDEX )
    154123      return;
    155     }
    156124
    157125    /*
     
    164132    object_blocks = (void**) _Workspace_Allocate( block_size );
    165133
    166     if ( !object_blocks ) {
    167       if ( !_Workspace_Free( new_object_block ) ) {
    168         _Internal_error_Occurred(
    169           INTERNAL_ERROR_CORE,
    170           true,
    171           INTERNAL_ERROR_WORKSPACE_ALLOCATION
    172         );
    173       }
     134    if ( !object_blocks )
    174135      return;
    175     }
    176    
     136
    177137    /*
    178138     *  Break the block into the various sections.
     
    238198    information->inactive_per_block = inactive_per_block;
    239199    information->local_table = local_table;
    240     information->maximum = (Objects_Maximum) maximum;
     200    information->maximum = maximum;
    241201    information->maximum_id = _Objects_Build_id(
    242202        information->the_api,
     
    255215
    256216  /*
    257    *  Assign the new object block to the object block table.
    258    */
    259 
    260   information->object_blocks[ block ] = new_object_block;
     217   *  Allocate the name table, and the objects
     218   */
     219
     220  if ( information->auto_extend ) {
     221    information->object_blocks[ block ] =
     222      _Workspace_Allocate(
     223        (information->allocation_size * information->size)
     224      );
     225
     226    if ( !information->object_blocks[ block ] )
     227      return;
     228  }
     229  else {
     230    information->object_blocks[ block ] =
     231      _Workspace_Allocate_or_fatal_error(
     232        (information->allocation_size * information->size)
     233      );
     234  }
    261235
    262236  /*
     
    292266
    293267  information->inactive_per_block[ block ] = information->allocation_size;
    294   information->inactive =
    295     (Objects_Maximum)(information->inactive + information->allocation_size);
     268  information->inactive += information->allocation_size;
    296269}
Note: See TracChangeset for help on using the changeset viewer.