Reduce structure internal padding. Group members used by _Objects_Get()
together. Reduce size of some members.
Format and simplify _Objects_Extend_information().
---
cpukit/include/rtems/score/objectimpl.h| 28 +++
cpukit/score/src/objectextendinformation.c | 116 +
2 files changed, 66 insertions(+), 78 deletions(-)
diff --git a/cpukit/include/rtems/score/objectimpl.h
b/cpukit/include/rtems/score/objectimpl.h
index 1bef14b116..bf4d45df4a 100644
--- a/cpukit/include/rtems/score/objectimpl.h
+++ b/cpukit/include/rtems/score/objectimpl.h
@@ -120,36 +120,36 @@ typedef void ( *Objects_Thread_queue_Extract_callout )(
* manage each class of objects.
*/
typedef struct {
- /** This field indicates the API of this object class. */
- Objects_APIs the_api;
- /** This is the class of this object set. */
- uint16_t the_class;
/** This is the minimum valid id of this object class. */
Objects_Idminimum_id;
/** This is the maximum valid id of this object class. */
Objects_Idmaximum_id;
+ /** This points to the table of local objects. */
+ Objects_Control **local_table;
/** This is the maximum number of objects in this class. */
Objects_Maximum maximum;
+ /** This is the number of objects on the Inactive list. */
+ Objects_Maximum inactive;
+ /** This is the number of objects in a block. */
+ Objects_Maximum allocation_size;
+ /** This is the maximum length of names. */
+ uint16_t name_length;
+ /** This field indicates the API of this object class. */
+ uint8_t the_api;
+ /** This is the class of this object set. */
+ uint8_t the_class;
/** This is true if names are strings. */
bool is_string;
/** This is the true if unlimited objects in this class. */
bool auto_extend;
- /** This is the number of objects in a block. */
- Objects_Maximum allocation_size;
/** This is the size in bytes of each object instance. */
size_tsize;
- /** This points to the table of local objects. */
- Objects_Control **local_table;
/** This is the chain of inactive control blocks. */
Chain_Control Inactive;
- /** This is the number of objects on the Inactive list. */
- Objects_Maximum inactive;
/** This is the number of inactive objects per block. */
- uint32_t *inactive_per_block;
+ Objects_Maximum *inactive_per_block;
/** This is a table to the chain of inactive object memory blocks. */
- void**object_blocks;
- /** This is the maximum length of names. */
- uint16_t name_length;
+ Objects_Control **object_blocks;
#if defined(RTEMS_MULTIPROCESSING)
/** This is this object class' method called when extracting a thread. */
Objects_Thread_queue_Extract_callout extract;
diff --git a/cpukit/score/src/objectextendinformation.c
b/cpukit/score/src/objectextendinformation.c
index f4ac11be43..d2ee7fdf8b 100644
--- a/cpukit/score/src/objectextendinformation.c
+++ b/cpukit/score/src/objectextendinformation.c
@@ -51,8 +51,8 @@ void _Objects_Extend_information(
uint32_t minimum_index;
uint32_t index;
uint32_t maximum;
- size_tblock_size;
- void *new_object_block;
+ size_tobject_block_size;
+ Objects_Control *new_object_block;
bool do_extend;
_Assert(
@@ -100,13 +100,13 @@ void _Objects_Extend_information(
* Allocate the name table, and the objects and if it fails either return or
* generate a fatal error depending on auto-extending being active.
*/
- block_size = information->allocation_size * information->size;
+ object_block_size = information->allocation_size * information->size;
if ( information->auto_extend ) {
-new_object_block = _Workspace_Allocate( block_size );
+new_object_block = _Workspace_Allocate( object_block_size );
if ( !new_object_block )
return;
} else {
-new_object_block = _Workspace_Allocate_or_fatal_error( block_size );
+new_object_block = _Workspace_Allocate_or_fatal_error( object_block_size );
}
/*
@@ -114,13 +114,13 @@ void _Objects_Extend_information(
*/
if ( do_extend ) {
ISR_lock_Context lock_context;
-void**object_blocks;
-uint32_t *inactive_per_block;
+Objects_Control **object_blocks;
Objects_Control **local_table;
+Objects_Maximum *inactive_per_block;
void *old_tables;
-size_tblock_size;
+size_ttable_size;
uintptr_t object_blocks_size;
-uintptr_t inactive_per_block_size;
+uintptr_t local_table_size;
/*
* Growing the tables means allocating a new area, doing a copy and
@@ -129,58 +129,49 @@ void _Objects_Extend_information(
* If the maximum is minimum we do not have a table to copy. First
* time through.
*
- * The allocation has :