From 635865aefd842e94e32856b8d32fbcacb52d78ba Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 Jan 2008 21:08:36 +0000 Subject: 2008-01-09 Joel Sherrill * libcsupport/Makefile.am, libcsupport/include/rtems/malloc.h, libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_deferred.c, libcsupport/src/malloc_initialize.c, libcsupport/src/malloc_p.h, libcsupport/src/malloc_sbrk_helpers.c, libcsupport/src/posix_memalign.c: Place all deferred free code and place it in subroutines. Add plugin for dirtying allocated memory to assist in debugging. Clean up comments and spacing as needed. * libcsupport/src/malloc_dirtier.c: New file. --- cpukit/libcsupport/src/malloc_deferred.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cpukit/libcsupport/src/malloc_deferred.c') diff --git a/cpukit/libcsupport/src/malloc_deferred.c b/cpukit/libcsupport/src/malloc_deferred.c index 9e8a259deb..57fd8752c3 100644 --- a/cpukit/libcsupport/src/malloc_deferred.c +++ b/cpukit/libcsupport/src/malloc_deferred.c @@ -22,6 +22,8 @@ #include "malloc_p.h" +Chain_Control RTEMS_Malloc_GC_list; + boolean malloc_is_system_state_OK(void) { if ( _Thread_Dispatch_disable_level > 0 ) @@ -33,7 +35,12 @@ boolean malloc_is_system_state_OK(void) return TRUE; } -void malloc_process_deferred_frees(void) +void malloc_deferred_frees_initialize(void) +{ + Chain_Initialize_empty(&RTEMS_Malloc_GC_list); +} + +void malloc_deferred_frees_process(void) { Chain_Node *to_be_freed; @@ -44,7 +51,7 @@ void malloc_process_deferred_frees(void) free(to_be_freed); } -void malloc_defer_free( +void malloc_deferred_free( void *pointer ) { -- cgit v1.2.3