[PATCH 5/7] score: Optimize object lookup
Sebastian Huber
sebastian.huber at embedded-brains.de
Wed Nov 28 07:20:52 UTC 2018
On 26/11/2018 14:12, Sebastian Huber wrote:
> The local table no longer needs a NULL pointer entry at array index
> zero. Adjust all the object iteration loops accordingly.
I think this is the only problematic change. Previously the local table
was organized like this:
Objects_Control *local_table[] = {
NULL, // Always
NULL or pointer to object with ID index 1 (the first valid index,
index zero is invalid),
NULL or pointer to object with ID index 2,
....
NULL or pointer to object with ID index maximum
}
Now it is:
Objects_Control *local_table[] = {
NULL or pointer to object with ID index 1 (the first valid index,
index zero is invalid),
NULL or pointer to object with ID index 2,
....
NULL or pointer to object with ID index maximum
}
This is just a minor space optimization. We could also keep the NULL
entry, but it is technically not required.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber at embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
More information about the devel
mailing list