summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/heapgetinfo.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-06-07 09:35:01 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-06-07 09:35:01 +0000
commitb2a0214d4395787eca8e74375d283bf26c9ca4a1 (patch)
treeeb91086d7da6342ea88ad774939bb90afcfd3e4f /cpukit/score/src/heapgetinfo.c
parent2010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff)
downloadrtems-b2a0214d4395787eca8e74375d283bf26c9ca4a1.tar.bz2
2010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* score/include/rtems/score/heap.h: Declare _Heap_Get_first_and_last_block(). Removed Heap_Extend_status. Changed return type of _Heap_Extend() to bool. * score/inline/rtems/score/heap.inl: Define _Heap_Set_last_block_size(). * score/src/heap.c: Define and use _Heap_Get_first_and_last_block(). * score/src/heapgetinfo.c: Removed assert statements. Do not count the last block. This ensures that all size values are an integral multiple of the page size which is consistent with the other statistics. * score/src/heapextend.c: Implemented support for scattered heap areas. * score/src/heapwalk.c: Dump also last block. Changes for new first and last block values. * ./score/src/pheapextend.c, rtems/src/regionextend.c: Update for _Heap_Extend() changes.
Diffstat (limited to 'cpukit/score/src/heapgetinfo.c')
-rw-r--r--cpukit/score/src/heapgetinfo.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/cpukit/score/src/heapgetinfo.c b/cpukit/score/src/heapgetinfo.c
index bc3d4cc893..bcb5a7f68d 100644
--- a/cpukit/score/src/heapgetinfo.c
+++ b/cpukit/score/src/heapgetinfo.c
@@ -21,6 +21,8 @@
#include "config.h"
#endif
+#include <string.h>
+
#include <rtems/system.h>
#include <rtems/score/sysstate.h>
#include <rtems/score/heap.h>
@@ -33,15 +35,7 @@ void _Heap_Get_information(
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));
-
- the_info->Free.number = 0;
- the_info->Free.total = 0;
- the_info->Free.largest = 0;
- the_info->Used.number = 0;
- the_info->Used.total = 0;
- the_info->Used.largest = 0;
+ memset(the_info, 0, sizeof(*the_info));
while ( the_block != end ) {
uintptr_t const the_size = _Heap_Block_size(the_block);
@@ -60,11 +54,4 @@ void _Heap_Get_information(
the_block = next_block;
}
-
- /*
- * Handle the last dummy block. Don't consider this block to be
- * "used" as client never allocated it. Make 'Used.total' contain this
- * blocks' overhead though.
- */
- the_info->Used.total += HEAP_BLOCK_HEADER_SIZE;
}