diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-11-24 11:51:28 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-12-07 14:22:01 +0100 |
commit | 3899bc1a4b3294306ae2fd3f8ff0ee10365d9f4b (patch) | |
tree | 3912fc89bbde8a64a20111e02c618e85eb7bb000 /cpukit/score/src/objectinitializeinformation.c | |
parent | score: Rename Objects_Information::allocation_size (diff) | |
download | rtems-3899bc1a4b3294306ae2fd3f8ff0ee10365d9f4b.tar.bz2 |
score: Optimize object lookup
Use the maximum ID for the ID to object translation. Using the maximum
ID gets rid of an additional load from the object information in
_Objects_Get(). In addition, object lookups fail for every ID in case
the object information is cleared to zero. This makes it a bit more
robust during system startup (see new tests in spconfig02).
The local table no longer needs a NULL pointer entry at array index
zero. Adjust all the object iteration loops accordingly.
Remove Objects_Information::minimum_id since it contains only redundant
information. Add _Objects_Get_minimum_id() to get the minimum ID.
Update #3621.
Diffstat (limited to 'cpukit/score/src/objectinitializeinformation.c')
-rw-r--r-- | cpukit/score/src/objectinitializeinformation.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/cpukit/score/src/objectinitializeinformation.c b/cpukit/score/src/objectinitializeinformation.c index a341dc1a5d..530e4e10ba 100644 --- a/cpukit/score/src/objectinitializeinformation.c +++ b/cpukit/score/src/objectinitializeinformation.c @@ -37,9 +37,7 @@ void _Objects_Do_initialize_information( #endif ) { - static Objects_Control *null_local_table = NULL; - uint32_t minimum_index; - Objects_Maximum maximum_per_allocation; + Objects_Maximum maximum_per_allocation; information->the_api = the_api; information->the_class = the_class; @@ -48,6 +46,7 @@ void _Objects_Do_initialize_information( information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; + information->local_table = NULL; /* * Set the maximum value to 0. It will be updated when objects are @@ -79,18 +78,6 @@ void _Objects_Do_initialize_information( information->objects_per_block = maximum_per_allocation; /* - * Provide a null local table entry for the case of any empty table. - */ - information->local_table = &null_local_table; - - /* - * Calculate minimum and maximum Id's - */ - minimum_index = (maximum_per_allocation == 0) ? 0 : 1; - information->minimum_id = - _Objects_Build_id( the_api, the_class, _Objects_Local_node, minimum_index ); - - /* * Calculate the maximum name length * * NOTE: Either 4 bytes for Classic API names or an arbitrary |