diff options
Diffstat (limited to 'cpukit/score/src/heapgetinfo.c')
-rw-r--r-- | cpukit/score/src/heapgetinfo.c | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/cpukit/score/src/heapgetinfo.c b/cpukit/score/src/heapgetinfo.c index 7f907170b9..bc3d4cc893 100644 --- a/cpukit/score/src/heapgetinfo.c +++ b/cpukit/score/src/heapgetinfo.c @@ -1,6 +1,12 @@ -/* - * Heap Handler +/** + * @file + * + * @ingroup ScoreHeap * + * @brief Heap Handler implementation. + */ + +/* * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * @@ -19,27 +25,13 @@ #include <rtems/score/sysstate.h> #include <rtems/score/heap.h> -/* - * _Heap_Get_information - * - * This kernel routine walks the heap and tots up the free and allocated - * sizes. Derived from _Heap_Walk. - * - * Input parameters: - * the_heap - pointer to heap header - * the_info - pointer for information to be returned - * - * Output parameters: - * *the_info - contains information about heap - * return 0=success, otherwise heap is corrupt. - */ -Heap_Get_information_status _Heap_Get_information( +void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { - Heap_Block *the_block = the_heap->start; - Heap_Block *const end = the_heap->final; + Heap_Block *the_block = the_heap->first_block; + Heap_Block *const end = the_heap->last_block; _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); @@ -52,7 +44,7 @@ Heap_Get_information_status _Heap_Get_information( the_info->Used.largest = 0; while ( the_block != end ) { - uint32_t const the_size = _Heap_Block_size(the_block); + uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; @@ -74,7 +66,5 @@ Heap_Get_information_status _Heap_Get_information( * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ - the_info->Used.total += HEAP_LAST_BLOCK_OVERHEAD; - - return HEAP_GET_INFORMATION_SUCCESSFUL; + the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; } |