diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-11-23 19:07:58 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1998-11-23 19:07:58 +0000 |
commit | 07a3253de2c3f9bc2d96a351680ec72548dadd2d (patch) | |
tree | b4f85e78927202cffe01b194c708c3dd800d8e57 /c/src/exec/libcsupport/src/malloc.c | |
parent | Added new tests in support of the file system infrastructure. (diff) | |
download | rtems-07a3253de2c3f9bc2d96a351680ec72548dadd2d.tar.bz2 |
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.
Diffstat (limited to 'c/src/exec/libcsupport/src/malloc.c')
-rw-r--r-- | c/src/exec/libcsupport/src/malloc.c | 14 |
1 files changed, 9 insertions, 5 deletions
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! */ |