mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-05 23:23:13 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
41
cpukit/libcsupport/src/mallocinfo.c
Normal file
41
cpukit/libcsupport/src/mallocinfo.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user