4.115
Last change
on this file since eea7c937 was
39046f7,
checked in by Sebastian Huber <sebastian.huber@…>, on 07/24/13 at 09:09:23
|
score: Merge sysstate API into one file
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup ScoreHeap |
---|
5 | * |
---|
6 | * @brief Heap Handler implementation. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * COPYRIGHT (c) 1989-2004. |
---|
11 | * On-Line Applications Research Corporation (OAR). |
---|
12 | * |
---|
13 | * The license and distribution terms for this file may be |
---|
14 | * found in the file LICENSE in this distribution or at |
---|
15 | * http://www.rtems.com/license/LICENSE. |
---|
16 | */ |
---|
17 | |
---|
18 | #if HAVE_CONFIG_H |
---|
19 | #include "config.h" |
---|
20 | #endif |
---|
21 | |
---|
22 | #include <rtems/system.h> |
---|
23 | #include <rtems/score/heapimpl.h> |
---|
24 | |
---|
25 | void _Heap_Get_free_information( |
---|
26 | Heap_Control *the_heap, |
---|
27 | Heap_Information *info |
---|
28 | ) |
---|
29 | { |
---|
30 | Heap_Block *the_block; |
---|
31 | Heap_Block *const tail = _Heap_Free_list_tail(the_heap); |
---|
32 | |
---|
33 | info->number = 0; |
---|
34 | info->largest = 0; |
---|
35 | info->total = 0; |
---|
36 | |
---|
37 | for(the_block = _Heap_Free_list_first(the_heap); |
---|
38 | the_block != tail; |
---|
39 | the_block = the_block->next) |
---|
40 | { |
---|
41 | uint32_t const the_size = _Heap_Block_size(the_block); |
---|
42 | |
---|
43 | /* As we always coalesce free blocks, prev block must have been used. */ |
---|
44 | _HAssert(_Heap_Is_prev_used(the_block)); |
---|
45 | |
---|
46 | info->number++; |
---|
47 | info->total += the_size; |
---|
48 | if ( info->largest < the_size ) |
---|
49 | info->largest = the_size; |
---|
50 | } |
---|
51 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.