summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectactivecount.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-11-25 20:15:26 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-12-07 14:22:02 +0100
commit1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98 (patch)
treeff95b47443c47377f1e9bcb7790cffb4b6e59bb0 /cpukit/score/src/objectactivecount.c
parentscore: Optimize object lookup (diff)
downloadrtems-1c2d17839760b0d8ad5a02e4c84bd8f99fac4e98.tar.bz2
score: Remove Objects_Information::maximum
This information is already present in Objects_Information::maximum_id. Add and use _Objects_Get_maximum_index(). Update #3621.
Diffstat (limited to 'cpukit/score/src/objectactivecount.c')
-rw-r--r--cpukit/score/src/objectactivecount.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpukit/score/src/objectactivecount.c b/cpukit/score/src/objectactivecount.c
index 376820158a..d29ce0736d 100644
--- a/cpukit/score/src/objectactivecount.c
+++ b/cpukit/score/src/objectactivecount.c
@@ -24,13 +24,14 @@ Objects_Maximum _Objects_Active_count(
const Objects_Information *information
)
{
- size_t inactive;
- size_t maximum;
+ Objects_Maximum inactive;
+ Objects_Maximum maximum;
_Assert( _Objects_Allocator_is_owner() );
- inactive = _Chain_Node_count_unprotected( &information->Inactive );
- maximum = information->maximum;
+ inactive = (Objects_Maximum)
+ _Chain_Node_count_unprotected( &information->Inactive );
+ maximum = _Objects_Get_maximum_index( information );
- return (Objects_Maximum) ( maximum - inactive );
+ return maximum - inactive;
}