Changeset 6af81435 in rtems


Ignore:
Timestamp:
Nov 12, 1999, 3:54:48 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
ea6bfcb
Parents:
1925ec9b
Message:

Corrected so now actually indexes into the allocation block.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/score/src/objectallocatebyindex.c

    r1925ec9b r6af81435  
    4646
    4747  if ( index && information->maximum >= index ) {
    48     /*
    49      *  If the object is already in the local table, then
    50      *  it has already been allocated/created by a previous
    51      *  create call.
    52      */
    53 
    5448    the_object = _Objects_Get_local_object( information, index );
    5549    if ( the_object )
     
    5852    /* XXX
    5953     *  This whole section of code needs to be addressed.
    60      *    +  The use of the index 0 for object_blocks should be dealt
    61      *       with more properly so we can autoextend.
     54     *    +  The 0 should be dealt with more properly so we can autoextend.
     55     *    +  The pointer arithmetic is probably too expensive.
    6256     *    +  etc.
    6357     */
    6458   
    65     the_object = (Objects_Control *) information->object_blocks[ 0 ];
    66 
     59    the_object = (Objects_Control *) _Addresses_Add_offset(
     60      information->object_blocks[ 0 ],
     61      (sizeof_control * (index - 1))
     62    );
    6763    _Chain_Extract( &the_object->Node );
    6864 
  • cpukit/score/src/objectallocatebyindex.c

    r1925ec9b r6af81435  
    4646
    4747  if ( index && information->maximum >= index ) {
    48     /*
    49      *  If the object is already in the local table, then
    50      *  it has already been allocated/created by a previous
    51      *  create call.
    52      */
    53 
    5448    the_object = _Objects_Get_local_object( information, index );
    5549    if ( the_object )
     
    5852    /* XXX
    5953     *  This whole section of code needs to be addressed.
    60      *    +  The use of the index 0 for object_blocks should be dealt
    61      *       with more properly so we can autoextend.
     54     *    +  The 0 should be dealt with more properly so we can autoextend.
     55     *    +  The pointer arithmetic is probably too expensive.
    6256     *    +  etc.
    6357     */
    6458   
    65     the_object = (Objects_Control *) information->object_blocks[ 0 ];
    66 
     59    the_object = (Objects_Control *) _Addresses_Add_offset(
     60      information->object_blocks[ 0 ],
     61      (sizeof_control * (index - 1))
     62    );
    6763    _Chain_Extract( &the_object->Node );
    6864 
Note: See TracChangeset for help on using the changeset viewer.