forked from Imagelibrary/rtems
score: Rename Objects_Information::size
Rename Objects_Information::size to Objects_Information::object_size. Change its type from size_t to uint16_t and move it to reduce the size of Objects_Information. Update #3621.
This commit is contained in:
@@ -132,6 +132,8 @@ typedef struct {
|
|||||||
Objects_Maximum inactive;
|
Objects_Maximum inactive;
|
||||||
/** This is the number of objects in a block. */
|
/** This is the number of objects in a block. */
|
||||||
Objects_Maximum allocation_size;
|
Objects_Maximum allocation_size;
|
||||||
|
/** This is the size in bytes of each object instance. */
|
||||||
|
uint16_t object_size;
|
||||||
/**
|
/**
|
||||||
* @brief This is the maximum length of names.
|
* @brief This is the maximum length of names.
|
||||||
*
|
*
|
||||||
@@ -145,8 +147,6 @@ typedef struct {
|
|||||||
uint8_t the_class;
|
uint8_t the_class;
|
||||||
/** This is the true if unlimited objects in this class. */
|
/** This is the true if unlimited objects in this class. */
|
||||||
bool auto_extend;
|
bool auto_extend;
|
||||||
/** This is the size in bytes of each object instance. */
|
|
||||||
size_t size;
|
|
||||||
/** This is the chain of inactive control blocks. */
|
/** This is the chain of inactive control blocks. */
|
||||||
Chain_Control Inactive;
|
Chain_Control Inactive;
|
||||||
/** This is the number of inactive objects per block. */
|
/** This is the number of inactive objects per block. */
|
||||||
@@ -227,7 +227,7 @@ void _Objects_Do_initialize_information(
|
|||||||
Objects_APIs the_api,
|
Objects_APIs the_api,
|
||||||
uint16_t the_class,
|
uint16_t the_class,
|
||||||
uint32_t maximum,
|
uint32_t maximum,
|
||||||
uint16_t size,
|
uint16_t object_size,
|
||||||
uint16_t maximum_name_length
|
uint16_t maximum_name_length
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
,
|
,
|
||||||
@@ -258,7 +258,7 @@ void _Objects_Do_initialize_information(
|
|||||||
* by this information block. It is specific to @a the_api.
|
* by this information block. It is specific to @a the_api.
|
||||||
* @param[in] maximum is the maximum number of instances of this object
|
* @param[in] maximum is the maximum number of instances of this object
|
||||||
* class which may be concurrently active.
|
* class which may be concurrently active.
|
||||||
* @param[in] size is the size of the data structure for this class.
|
* @param[in] object_size is the size of the data structure for this class.
|
||||||
* @param[in] is_string is true if this object uses string style names.
|
* @param[in] is_string is true if this object uses string style names.
|
||||||
* @param[in] maximum_name_length is the maximum length of object names.
|
* @param[in] maximum_name_length is the maximum length of object names.
|
||||||
*/
|
*/
|
||||||
@@ -268,7 +268,7 @@ void _Objects_Do_initialize_information(
|
|||||||
the_api, \
|
the_api, \
|
||||||
the_class, \
|
the_class, \
|
||||||
maximum, \
|
maximum, \
|
||||||
size, \
|
object_size, \
|
||||||
maximum_name_length, \
|
maximum_name_length, \
|
||||||
extract \
|
extract \
|
||||||
) \
|
) \
|
||||||
@@ -277,7 +277,7 @@ void _Objects_Do_initialize_information(
|
|||||||
the_api, \
|
the_api, \
|
||||||
the_class, \
|
the_class, \
|
||||||
maximum, \
|
maximum, \
|
||||||
size, \
|
object_size, \
|
||||||
maximum_name_length, \
|
maximum_name_length, \
|
||||||
extract \
|
extract \
|
||||||
)
|
)
|
||||||
@@ -287,7 +287,7 @@ void _Objects_Do_initialize_information(
|
|||||||
the_api, \
|
the_api, \
|
||||||
the_class, \
|
the_class, \
|
||||||
maximum, \
|
maximum, \
|
||||||
size, \
|
object_size, \
|
||||||
maximum_name_length, \
|
maximum_name_length, \
|
||||||
extract \
|
extract \
|
||||||
) \
|
) \
|
||||||
@@ -296,7 +296,7 @@ void _Objects_Do_initialize_information(
|
|||||||
the_api, \
|
the_api, \
|
||||||
the_class, \
|
the_class, \
|
||||||
maximum, \
|
maximum, \
|
||||||
size, \
|
object_size, \
|
||||||
maximum_name_length \
|
maximum_name_length \
|
||||||
)
|
)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Objects_Control *_Objects_Allocate_unprotected(
|
|||||||
* should be all zeroed out because it is in the BSS. So let's
|
* should be all zeroed out because it is in the BSS. So let's
|
||||||
* check that code for this manager is even present.
|
* check that code for this manager is even present.
|
||||||
*/
|
*/
|
||||||
if ( information->size == 0 )
|
if ( information->object_size == 0 )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ void _Objects_Extend_information(
|
|||||||
* Allocate the name table, and the objects and if it fails either return or
|
* Allocate the name table, and the objects and if it fails either return or
|
||||||
* generate a fatal error depending on auto-extending being active.
|
* generate a fatal error depending on auto-extending being active.
|
||||||
*/
|
*/
|
||||||
object_block_size = information->allocation_size * information->size;
|
object_block_size = information->allocation_size * information->object_size;
|
||||||
if ( information->auto_extend ) {
|
if ( information->auto_extend ) {
|
||||||
new_object_block = _Workspace_Allocate( object_block_size );
|
new_object_block = _Workspace_Allocate( object_block_size );
|
||||||
if ( !new_object_block )
|
if ( !new_object_block )
|
||||||
@@ -261,6 +261,6 @@ void _Objects_Extend_information(
|
|||||||
_Chain_Initialize_node( &the_object->Node );
|
_Chain_Initialize_node( &the_object->Node );
|
||||||
_Chain_Append_unprotected( &information->Inactive, &the_object->Node );
|
_Chain_Append_unprotected( &information->Inactive, &the_object->Node );
|
||||||
|
|
||||||
the_object = _Addresses_Add_offset( the_object, information->size );
|
the_object = _Addresses_Add_offset( the_object, information->object_size );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ void _Objects_Do_initialize_information(
|
|||||||
Objects_APIs the_api,
|
Objects_APIs the_api,
|
||||||
uint16_t the_class,
|
uint16_t the_class,
|
||||||
uint32_t maximum,
|
uint32_t maximum,
|
||||||
uint16_t size,
|
uint16_t object_size,
|
||||||
uint16_t maximum_name_length
|
uint16_t maximum_name_length
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
,
|
,
|
||||||
@@ -43,7 +43,7 @@ void _Objects_Do_initialize_information(
|
|||||||
|
|
||||||
information->the_api = the_api;
|
information->the_api = the_api;
|
||||||
information->the_class = the_class;
|
information->the_class = the_class;
|
||||||
information->size = size;
|
information->object_size = object_size;
|
||||||
information->local_table = 0;
|
information->local_table = 0;
|
||||||
information->inactive_per_block = 0;
|
information->inactive_per_block = 0;
|
||||||
information->object_blocks = 0;
|
information->object_blocks = 0;
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ bool _Thread_Initialize(
|
|||||||
memset(
|
memset(
|
||||||
&the_thread->Join_queue,
|
&the_thread->Join_queue,
|
||||||
0,
|
0,
|
||||||
information->Objects.size - offsetof( Thread_Control, Join_queue )
|
information->Objects.object_size - offsetof( Thread_Control, Join_queue )
|
||||||
);
|
);
|
||||||
|
|
||||||
for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) {
|
for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user