diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-07-11 20:56:10 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2007-07-11 20:56:10 +0000 |
commit | 55d7626db75b1b5323aa5ba16b3cbc0a985462fe (patch) | |
tree | c4268b9ad2466b12170205743fd97d425da18e8a /cpukit/libcsupport | |
parent | 2007-07-11 Joel Sherrill <joel.sherrill@oarcorp.com> (diff) | |
download | rtems-55d7626db75b1b5323aa5ba16b3cbc0a985462fe.tar.bz2 |
2007-07-11 Joel Sherrill <joel.sherrill@oarcorp.com>
* libcsupport/src/malloc.c: Clean up Malloc debug code.
* score/include/rtems/score/heap.h: Spacing.
* score/inline/rtems/score/thread.inl:
* score/src/heapfree.c. Clean up and add explicit check of the address
being freed actually being in the heap.
* score/src/heapwalk.c: Switch to printk and do not call abort.
Diffstat (limited to 'cpukit/libcsupport')
-rw-r--r-- | cpukit/libcsupport/src/malloc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cpukit/libcsupport/src/malloc.c b/cpukit/libcsupport/src/malloc.c index 21648c52f6..16d69025d0 100644 --- a/cpukit/libcsupport/src/malloc.c +++ b/cpukit/libcsupport/src/malloc.c @@ -94,6 +94,8 @@ size_t RTEMS_Malloc_Sbrk_amount; #ifdef RTEMS_DEBUG #define MALLOC_STATS #define MALLOC_DIRTY +/*#define MALLOC_ARENA_CHECK +void checkMallocArena(void); */ #endif #ifdef MALLOC_STATS @@ -282,7 +284,8 @@ void *malloc( { size_t actual_size = 0; uint32_t current_depth; - Protected_heap_Get_block_size(&RTEMS_Malloc_Heap, ptr, &actual_size); + void *ptr = return_this; + _Protected_heap_Get_block_size(&RTEMS_Malloc_Heap, ptr, &actual_size); MSBUMP(lifetime_allocated, actual_size); current_depth = rtems_malloc_stats.lifetime_allocated - rtems_malloc_stats.lifetime_freed; @@ -464,7 +467,7 @@ void free( #ifdef MALLOC_STATS { size_t size; - if (Protected_heap_Get_block_size(&RTEMS_Malloc_Heap, ptr, &size) ) { + if (_Protected_heap_Get_block_size(&RTEMS_Malloc_Heap, ptr, &size) ) { MSBUMP(lifetime_freed, size); } } |