From 3899bc1a4b3294306ae2fd3f8ff0ee10365d9f4b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 24 Nov 2018 11:51:28 +0100 Subject: 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. --- cpukit/posix/src/killinfo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cpukit/posix/src/killinfo.c') diff --git a/cpukit/posix/src/killinfo.c b/cpukit/posix/src/killinfo.c index 6f45b29ec6..cabd91c700 100644 --- a/cpukit/posix/src/killinfo.c +++ b/cpukit/posix/src/killinfo.c @@ -210,7 +210,7 @@ int _POSIX_signals_Send( maximum = the_info->maximum; object_table = the_info->local_table; - for ( index = 1 ; index <= maximum ; index++ ) { + for ( index = 0 ; index < maximum ; ++index ) { the_thread = (Thread_Control *) object_table[ index ]; if ( !the_thread ) -- cgit v1.2.3