diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-22 06:38:42 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-07 14:22:01 +0100 |
commit | 359a3a36ca9bf82054fe6a83bd97868c310e5aae (patch) | |
tree | 431e2a12d7950abe39bc63e55d862232c0a3ce4e /cpukit/score/src/objectshrinkinformation.c | |
parent | score: Rename Objects_Information::size (diff) | |
download | rtems-359a3a36ca9bf82054fe6a83bd97868c310e5aae.tar.bz2 |
score: Rename Objects_Information::allocation_size
Rename Objects_Information::allocation_size in
Objects_Information::objects_per_block. Adjust integer types in
_Objects_Shrink_information() and _Objects_Free().
Update #3621.
Diffstat (limited to 'cpukit/score/src/objectshrinkinformation.c')
-rw-r--r-- | cpukit/score/src/objectshrinkinformation.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/cpukit/score/src/objectshrinkinformation.c b/cpukit/score/src/objectshrinkinformation.c index db085e1042..cf3618f8fa 100644 --- a/cpukit/score/src/objectshrinkinformation.c +++ b/cpukit/score/src/objectshrinkinformation.c @@ -27,9 +27,10 @@ void _Objects_Shrink_information( Objects_Information *information ) { - uint32_t block_count; - uint32_t block; - uint32_t index_base; + Objects_Maximum objects_per_block; + Objects_Maximum index_base; + Objects_Maximum block_count; + Objects_Maximum block; _Assert( _Objects_Allocator_is_owner() ); @@ -37,20 +38,26 @@ void _Objects_Shrink_information( * Search the list to find block or chunk with all objects inactive. */ + objects_per_block = information->objects_per_block; index_base = _Objects_Get_index( information->minimum_id ); - block_count = (information->maximum - index_base) / - information->allocation_size; + block_count = ( information->maximum - index_base ) / objects_per_block; for ( block = 0; block < block_count; block++ ) { - if ( information->inactive_per_block[ block ] == - information->allocation_size ) { - Chain_Node *node = _Chain_First( &information->Inactive ); - const Chain_Node *tail = _Chain_Immutable_tail( &information->Inactive ); - uint32_t index_end = index_base + information->allocation_size; + if ( information->inactive_per_block[ block ] == objects_per_block ) { + Chain_Node *node; + const Chain_Node *tail; + uint32_t index_end; + + node = _Chain_First( &information->Inactive ); + tail = _Chain_Immutable_tail( &information->Inactive ); + index_end = index_base + objects_per_block; while ( node != tail ) { - Objects_Control *object = (Objects_Control *) node; - uint32_t index = _Objects_Get_index( object->id ); + Objects_Control *object; + uint32_t index; + + object = (Objects_Control *) node; + index = _Objects_Get_index( object->id ); /* * Get the next node before the node is extracted @@ -70,11 +77,11 @@ void _Objects_Shrink_information( information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; - information->inactive -= information->allocation_size; + information->inactive -= objects_per_block; return; } - index_base += information->allocation_size; + index_base += objects_per_block; } } |