source: rtems/cpukit/libcsupport/src/mallocinfo.c @ 543fe820

4.104.114.9
Last change on this file since 543fe820 was 543fe820, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 18, 2007 at 8:36:40 PM

2007-12-18 Joel Sherrill <joel.sherrill@…>

  • libcsupport/Makefile.am, libcsupport/preinstall.am, libcsupport/src/malloc.c, libcsupport/src/mallocinfo.c, libmisc/Makefile.am, libmisc/shell/main_mallocinfo.c, libmisc/shell/shellconfig.h: Split malloc.c into multiple files with one function per file. Also split out statistics into a separate file which can be plugged in dynamically. Right now, it is always in. I suspect that splitting the file removed more code than leaving statistics in. I tinkered with malloc information command in the shell. I resurrected the malloc arena code as malloc boundary. This code is now compiled all the time even though it does not appear to work.
  • libcsupport/include/rtems/malloc.h, libcsupport/src/_calloc_r.c, libcsupport/src/_free_r.c, libcsupport/src/_malloc_r.c, libcsupport/src/_realloc_r.c, libcsupport/src/calloc.c, libcsupport/src/free.c, libcsupport/src/malloc_boundary.c, libcsupport/src/malloc_get_statistics.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_report_statistics.c, libcsupport/src/malloc_report_statistics_plugin.c, libcsupport/src/malloc_statistics_helpers.c, libcsupport/src/malloc_walk.c, libcsupport/src/realloc.c, libmisc/shell/main_perioduse.c: New files.
  • Property mode set to 100644
File size: 750 bytes
Line 
1/*
2 *  RTEMS Malloc Get Status Information
3 *
4 *
5 *  COPYRIGHT (c) 1989-2007.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.com/license/LICENSE.
11 *
12 *  $Id$
13 */
14
15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
19#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
20#include <rtems.h>
21#include <rtems/libcsupport.h>
22#include <rtems/score/protectedheap.h>
23
24extern Heap_Control  RTEMS_Malloc_Heap;
25
26/*
27 *  Find amount of free heap remaining
28 */
29
30int malloc_info(
31  Heap_Information_block *the_info
32)
33{
34  if ( !the_info )
35    return -1;
36
37  _Protected_heap_Get_information( &RTEMS_Malloc_Heap, the_info );
38  return 0;
39}
Note: See TracBrowser for help on using the repository browser.