source: rtems/cpukit/score/src/heapgetinfo.c @ 7121a9fa

4.11
Last change on this file since 7121a9fa was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on May 3, 2012 at 3:09:24 PM

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • 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-2009.
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 <string.h>
23
24#include <rtems/score/heap.h>
25
26static bool _Heap_Get_information_visitor(
27  const Heap_Block *block __attribute__((unused)),
28  uintptr_t block_size,
29  bool block_is_used,
30  void *visitor_arg
31)
32{
33  Heap_Information_block *info_block = visitor_arg;
34  Heap_Information *info = block_is_used ?
35    &info_block->Used : &info_block->Free;
36
37  ++info->number;
38  info->total += block_size;
39  if ( info->largest < block_size )
40    info->largest = block_size;
41
42  return false;
43}
44
45void _Heap_Get_information(
46  Heap_Control            *the_heap,
47  Heap_Information_block  *the_info
48)
49{
50  memset( the_info, 0, sizeof(*the_info) );
51  _Heap_Iterate( the_heap, _Heap_Get_information_visitor, the_info );
52}
Note: See TracBrowser for help on using the repository browser.