source:
rtems/cpukit/libcsupport/src/mallocfreespace.c
@
ae75429
Last change on this file since ae75429 was ae75429, checked in by Sebastian Huber <sebastian.huber@…>, on 08/06/13 at 14:10:26 | |
---|---|
|
|
File size: 815 bytes |
Rev | Line | |
---|---|---|
[cefc9aea] | 1 | /** |
2 | * @file | |
[3815a2b] | 3 | * |
[cefc9aea] | 4 | * @brief RTEMS Malloc Get Free Information |
5 | * @ingroup libcsupport | |
6 | */ | |
7 | ||
8 | /* | |
[71c012af] | 9 | * COPYRIGHT (c) 1989-2010. |
[3815a2b] | 10 | * On-Line Applications Research Corporation (OAR). |
11 | * | |
12 | * The license and distribution terms for this file may be | |
13 | * found in the file LICENSE in this distribution or at | |
[0eae36c7] | 14 | * http://www.rtems.com/license/LICENSE. |
[3815a2b] | 15 | */ |
16 | ||
[9c49db4] | 17 | #if HAVE_CONFIG_H |
18 | #include "config.h" | |
19 | #endif | |
20 | ||
[3815a2b] | 21 | #include <rtems.h> |
[3ba74c73] | 22 | #include <rtems/libcsupport.h> |
[e746a88] | 23 | #include <rtems/score/protectedheap.h> |
[3815a2b] | 24 | |
25 | #include <stdio.h> | |
26 | #include <stdlib.h> | |
27 | #include <sys/types.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 | ||
37 | size_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.