From 07a3253de2c3f9bc2d96a351680ec72548dadd2d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 23 Nov 1998 19:07:58 +0000 Subject: Added base version of file system infrastructure. This includes a major overhaul of the RTEMS system call interface. This base file system is the "In-Memory File System" aka IMFS. The design and implementation was done by the following people: + Joel Sherrill (joel@OARcorp.com) + Jennifer Averett (jennifer@OARcorp.com) + Steve "Mr Mount" Salitasc (salitasc@OARcorp.com) + Kerwin Wade (wade@OARcorp.com) PROBLEMS ======== + It is VERY likely that merging this will break the UNIX port. This can/will be fixed. + There is likely some reentrancy/mutual exclusion needed. + Eventually, there should be a "mini-IMFS" description table to eliminate links, symlinks, etc to save memory. All you need to have "classic RTEMS" functionality is technically directories and device IO. All the rest could be left out to save memory. --- c/src/exec/libcsupport/src/malloc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'c/src/exec/libcsupport/src/malloc.c') diff --git a/c/src/exec/libcsupport/src/malloc.c b/c/src/exec/libcsupport/src/malloc.c index fac38585a7..f164e45f6c 100644 --- a/c/src/exec/libcsupport/src/malloc.c +++ b/c/src/exec/libcsupport/src/malloc.c @@ -135,7 +135,7 @@ void RTEMS_Malloc_Initialize( #ifdef MALLOC_STATS /* zero all the stats */ - (void) memset(&rtems_malloc_stats, 0, sizeof(rtems_malloc_stats)); + (void) memset( &rtems_malloc_stats, 0, sizeof(rtems_malloc_stats) ); #endif MSBUMP(space_available, length); @@ -220,9 +220,11 @@ void *malloc( { unsigned32 actual_size; unsigned32 current_depth; - status = rtems_region_get_segment_size(RTEMS_Malloc_Heap, return_this, &actual_size); + status = rtems_region_get_segment_size( + RTEMS_Malloc_Heap, return_this, &actual_size); MSBUMP(lifetime_allocated, actual_size); - current_depth = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed; + current_depth = rtems_malloc_stats.lifetime_allocated - + rtems_malloc_stats.lifetime_freed; if (current_depth > rtems_malloc_stats.max_depth) rtems_malloc_stats.max_depth = current_depth; } @@ -335,10 +337,12 @@ void free( void malloc_dump(void) { - unsigned32 allocated = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed; + unsigned32 allocated = rtems_malloc_stats.lifetime_allocated - + rtems_malloc_stats.lifetime_freed; printf("Malloc stats\n"); - printf(" avail:%uk allocated:%uk (%d%%) max:%uk (%d%%) lifetime:%Luk freed:%Luk\n", + printf(" avail:%uk allocated:%uk (%d%%) " + "max:%uk (%d%%) lifetime:%Luk freed:%Luk\n", (unsigned int) rtems_malloc_stats.space_available / 1024, (unsigned int) allocated / 1024, /* avoid float! */ -- cgit v1.2.3