[PATCH] score: Fix _Objects_Shrink_information()
Ralf Corsepius
ralf.corsepius at rtems.org
Fri Jan 4 09:30:43 UTC 2013
On 01/03/2013 05:08 PM, Sebastian Huber wrote:
> The chain iteration was wrong. The chain tail is not an object.
> ---
> cpukit/score/src/objectshrinkinformation.c | 36 ++++++++++++---------------
> 1 files changed, 16 insertions(+), 20 deletions(-)
>
> diff --git a/cpukit/score/src/objectshrinkinformation.c b/cpukit/score/src/objectshrinkinformation.c
> index de32f24..466a85d 100644
> --- a/cpukit/score/src/objectshrinkinformation.c
> +++ b/cpukit/score/src/objectshrinkinformation.c
> @@ -34,12 +34,9 @@ void _Objects_Shrink_information(
> Objects_Information *information
> )
> {
> - Objects_Control *the_object;
> - Objects_Control *extract_me;
> uint32_t block_count;
> uint32_t block;
> uint32_t index_base;
> - uint32_t index;
>
> /*
> * Search the list to find block or chunk with all objects inactive.
> @@ -52,25 +49,24 @@ void _Objects_Shrink_information(
> for ( block = 0; block < block_count; block++ ) {
> if ( information->inactive_per_block[ block ] ==
> information->allocation_size ) {
> + Chain_Node *node = _Chain_First( &information->Inactive );
> + const Chain_Node *tail = _Chain_Immutable_tail( &information->Inactive );
> + uint32_t index_end = index_base + information->allocation_size;
FWIW: I believe all these "index*" vars, should be size_t (or may be
off_t) and not be uint32_t.
Dunno of-head if this can easily be changed or if this just one of links
in the long chains of uint32_t vs. size_t vs. off_t issues RTEMS is
known to suffer from.
Ralf
More information about the devel
mailing list