2007-12-17 Joel Sherrill <joel.sherrill@oarcorp.com>

* libcsupport/Makefile.am, libcsupport/src/mallocfreespace.c: Add
	malloc_info() routine.
	* libcsupport/src/mallocinfo.c: New file.
This commit is contained in:
Joel Sherrill
2007-12-17 22:36:45 +00:00
parent 0ca6d0d938
commit ad9255bedd
4 changed files with 51 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2007-12-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/Makefile.am, libcsupport/src/mallocfreespace.c: Add
malloc_info() routine.
* libcsupport/src/mallocinfo.c: New file.
2007-12-17 Joel Sherrill <joel.sherrill@oarcorp.com>
* libmisc/stackchk/check.c: Add print of current stack pointer and

View File

@@ -78,8 +78,8 @@ ID_C_FILES = src/getegid.c src/geteuid.c src/getgid.c src/getgroups.c \
src/getlogin.c src/getpgrp.c src/getpid.c src/getppid.c src/getuid.c \
src/setpgid.c src/setsid.c
MALLOC_C_FILES = src/malloc.c src/mallocfreespace.c src/__brk.c \
src/__sbrk.c
MALLOC_C_FILES = src/malloc.c src/mallocfreespace.c src/mallocinfo.c \
src/__brk.c src/__sbrk.c
PASSWORD_GROUP_C_FILES = src/getpwent.c

View File

@@ -1,8 +1,8 @@
/*
* RTEMS Malloc Get Status Information
* RTEMS Malloc Get Free Information
*
*
* COPYRIGHT (c) 1989-2000.
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be

View File

@@ -0,0 +1,41 @@
/*
* RTEMS Malloc Get Status Information
*
*
* COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
#if HAVE_CONFIG_H
#include "config.h"
#endif
#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__
#include <rtems.h>
#include <rtems/libcsupport.h>
#include <rtems/score/protectedheap.h>
extern Heap_Control RTEMS_Malloc_Heap;
/*
* Find amount of free heap remaining
*/
int malloc_info(
Heap_Information_block *the_info
)
{
Heap_Information info;
if ( !the_info )
return -1;
_Protected_heap_Get_information( &RTEMS_Malloc_Heap, the_info );
return 0;
}