source: rtems/cpukit/libcsupport/src/mallocfreespace.c @ bd5984de

4.104.115
Last change on this file since bd5984de was bd5984de, checked in by Joel Sherrill <joel.sherrill@…>, on 09/17/08 at 18:37:55

2008-09-17 Joel Sherrill <joel.sherrill@…>

  • libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_sbrk_helpers.c, libcsupport/src/malloc_statistics_helpers.c, libcsupport/src/malloc_walk.c, libcsupport/src/mallocfreespace.c, libcsupport/src/mallocinfo.c, libcsupport/src/realloc.c, libcsupport/src/rtems_memalign.c, sapi/include/confdefs.h, score/inline/rtems/score/thread.inl: Add support for optionally having a unified work area. In other words, the RTEMS Workspace and C Program Heap are the same pool of memory.
  • Property mode set to 100644
File size: 843 bytes
RevLine 
[3815a2b]1/*
[ad9255be]2 *  RTEMS Malloc Get Free Information
[3815a2b]3 *
4 *
[ad9255be]5 *  COPYRIGHT (c) 1989-2007.
[3815a2b]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
[0eae36c7]10 *  http://www.rtems.com/license/LICENSE.
[3815a2b]11 *
12 *  $Id$
13 */
14
[9c49db4]15#if HAVE_CONFIG_H
16#include "config.h"
17#endif
18
[3815a2b]19#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
20#include <rtems.h>
[3ba74c73]21#include <rtems/libcsupport.h>
[e746a88]22#include <rtems/score/protectedheap.h>
[3815a2b]23
24#include <stdio.h>
25#include <stdlib.h>
26#include <sys/types.h>
27#include <assert.h>
28#include <errno.h>
29#include <string.h>
30
[bd5984de]31#include "malloc_p.h"
[3815a2b]32
33/*
34 *  Find amount of free heap remaining
35 */
36
37size_t malloc_free_space( void )
38{
[e746a88]39  Heap_Information info;
[3815a2b]40
[bd5984de]41  _Protected_heap_Get_free_information( RTEMS_Malloc_Heap, &info );
[e746a88]42  return (size_t) info.largest;
[3815a2b]43}
Note: See TracBrowser for help on using the repository browser.