summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectextendinformation.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-08 15:01:52 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-01-08 15:01:52 +0000
commitd041e594e2bd81804b7f11cfb602a9a0578f78ec (patch)
tree2a03e91701d0a35fe96dc1098b62c2b54e54c36b /cpukit/score/src/objectextendinformation.c
parent2009-01-06 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-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/score/src/objectextendinformation.c')
-rw-r--r--cpukit/score/src/objectextendinformation.c26
1 files changed, 7 insertions, 19 deletions
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(