diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-13 14:42:43 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-07-18 09:33:16 +0200 |
commit | 12a03bea4f936f6305869b43f9c0a5f1473213e9 (patch) | |
tree | dc1aa1f24d89bdd4565053d082673c0a0183108f /cpukit/score/src/objectfree.c | |
parent | spunlimited01: New test (diff) | |
download | rtems-12a03bea4f936f6305869b43f9c0a5f1473213e9.tar.bz2 |
score: Fix unlimited objects support
Commit 21275b58a5a69c3c838082ffc8a7a3641f32ea9a ("score: Static
Objects_Information initialization") introduced an off-by-one error in the
maintenance of inactive objects.
Close #4677.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/objectfree.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/cpukit/score/src/objectfree.c b/cpukit/score/src/objectfree.c index 45b2ba2c86..06d7d82672 100644 --- a/cpukit/score/src/objectfree.c +++ b/cpukit/score/src/objectfree.c @@ -51,14 +51,16 @@ void _Objects_Free_unlimited( if ( _Objects_Is_auto_extend( information ) ) { Objects_Maximum objects_per_block; - Objects_Maximum block; - Objects_Maximum inactive; + Objects_Maximum index; objects_per_block = information->objects_per_block; - block = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM; + index = _Objects_Get_index( the_object->id ) - OBJECTS_INDEX_MINIMUM; - if ( block > objects_per_block ) { - block /= objects_per_block; + if ( _Objects_Is_in_allocated_block( index, objects_per_block ) ) { + Objects_Maximum block; + Objects_Maximum inactive; + + block = index / objects_per_block; ++information->inactive_per_block[ block ]; |