From cfcc4e202d928690c46a083ce594aa0d505bf302 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 8 Jan 2008 22:59:14 +0000 Subject: 2008-01-08 Joel Sherrill * libcsupport/Makefile.am: Add malloc_sbrk_helpers.c. * libcsupport/include/rtems/malloc.h, libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_statistics_helpers.c: Make sbrk() support pluggable and optional. This eliminates the need for heap extend and sbrk in the minimum footprint which is ~2.5K on the SPARC. * sapi/include/confdefs.h: Add the following configuration points: + CONFIGURE_MALLOC_STATISTICS + CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK * libcsupport/src/malloc_sbrk_helpers.c: New file. --- cpukit/libcsupport/include/rtems/malloc.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'cpukit/libcsupport/include/rtems/malloc.h') diff --git a/cpukit/libcsupport/include/rtems/malloc.h b/cpukit/libcsupport/include/rtems/malloc.h index 763830397a..6bb152bbf9 100644 --- a/cpukit/libcsupport/include/rtems/malloc.h +++ b/cpukit/libcsupport/include/rtems/malloc.h @@ -5,14 +5,14 @@ /* * RTEMS Malloc Extensions * - * COPYRIGHT (c) 1989-1997. + * COPYRIGHT (c) 1989-2007. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may in * the file LICENSE in this distribution or at * http://www.rtems.com/license/LICENSE. * - * $ld: + * $Id$ */ #ifndef _RTEMS_MALLOC_H @@ -45,11 +45,11 @@ typedef struct { void (*initialize)(void); void (*at_malloc)(void *); void (*at_free)(void *); -} rtems_malloc_statististics_functions_t; +} rtems_malloc_statistics_functions_t; -extern rtems_malloc_statististics_functions_t +extern rtems_malloc_statistics_functions_t rtems_malloc_statistics_helpers_table; -extern rtems_malloc_statististics_functions_t *rtems_malloc_statistics_helpers; +extern rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers; /* * Malloc boundary support plugin @@ -65,7 +65,16 @@ typedef struct { extern rtems_malloc_boundary_functions_t rtems_malloc_boundary_helpers_table; extern rtems_malloc_boundary_functions_t *rtems_malloc_boundary_helpers; +/* + * Malloc Heap Extension (sbrk) plugin + */ +typedef struct { + void *(*initialize)(void *, size_t); + void *(*extend)(size_t); +} rtems_malloc_sbrk_functions_t; +extern rtems_malloc_sbrk_functions_t rtems_malloc_sbrk_helpers_table; +extern rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers; /** @brief Print Malloc Statistic Usage Report * -- cgit v1.2.3