diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-08 15:01:52 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-08 15:01:52 +0000 |
commit | d041e594e2bd81804b7f11cfb602a9a0578f78ec (patch) | |
tree | 2a03e91701d0a35fe96dc1098b62c2b54e54c36b /cpukit | |
parent | 2009-01-06 Joel Sherrill <joel.sherrill@OARcorp.com> (diff) | |
download | rtems-d041e594e2bd81804b7f11cfb602a9a0578f78ec.tar.bz2 |
2009-01-08 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/objectextendinformation.c: Fold two paths into one.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 4 | ||||
-rw-r--r-- | cpukit/score/src/objectextendinformation.c | 26 |
2 files changed, 11 insertions, 19 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index 76a8639839..368c2cd89d 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,7 @@ +2009-01-08 Joel Sherrill <joel.sherrill@OARcorp.com> + + * score/src/objectextendinformation.c: Fold two paths into one. + 2009-01-06 Ralf Corsépius <ralf.corsepius@rtems.org> * rtems/src/barrier.c, rtems/src/barrierwait.c, diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index f699e940a3..6718122abf 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -87,6 +87,7 @@ void _Objects_Extend_information( Objects_Control **local_table; uint32_t maximum; void *old_tables; + size_t block_size; /* * Growing the tables means allocating a new area, doing a copy and @@ -125,29 +126,16 @@ void _Objects_Extend_information( * Allocate the tables and break it up. */ - if ( information->auto_extend ) { - object_blocks = (void**) - _Workspace_Allocate( - block_count * - (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + - ((maximum + minimum_index) * sizeof(Objects_Control *)) - ); + block_size = block_count * + (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + + ((maximum + minimum_index) * sizeof(Objects_Control *)); + object_blocks = (void**) _Workspace_Allocate( block_size ); - if ( !object_blocks ) - return; - } - else { - object_blocks = (void**) - _Workspace_Allocate_or_fatal_error( - block_count * - (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + - ((maximum + minimum_index) * sizeof(Objects_Control *)) - ); - } + if ( !object_blocks ) + return; /* * Break the block into the various sections. - * */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( |