diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-09-29 17:19:16 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1995-09-29 17:19:16 +0000 |
commit | 11290355c9454c575d56c7928a725fd95e88d6f8 (patch) | |
tree | 1cd5ff063250cff764a59189f1e1956c40925a35 /cpukit/score/src/heap.c | |
parent | new programs added (diff) | |
download | rtems-11290355c9454c575d56c7928a725fd95e88d6f8.tar.bz2 |
all targets compile .. tony's patches in place
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/heap.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cpukit/score/src/heap.c b/cpukit/score/src/heap.c index 2380678209..bccd30ccc0 100644 --- a/cpukit/score/src/heap.c +++ b/cpukit/score/src/heap.c @@ -301,7 +301,7 @@ boolean _Heap_Size_of_user_area( Heap_Block *next_block; unsigned32 the_size; - the_block = _Heap_User_Block_at( starting_address ); + the_block = _Heap_User_block_at( starting_address ); if ( !_Heap_Is_block_in( the_heap, the_block ) || _Heap_Is_block_free( the_block ) ) @@ -346,7 +346,7 @@ boolean _Heap_Free( Heap_Block *temporary_block; unsigned32 the_size; - the_block = _Heap_User_Block_at( starting_address ); + the_block = _Heap_User_block_at( starting_address ); if ( !_Heap_Is_block_in( the_heap, the_block ) || _Heap_Is_block_free( the_block ) ) { @@ -430,6 +430,8 @@ void _Heap_Walk( Heap_Block *the_block = 0; /* avoid warnings */ Heap_Block *next_block = 0; /* avoid warnings */ int notdone = 1; + int error = 0; + int passes = 0; /* * We don't want to allow walking the heap until we have @@ -455,9 +457,14 @@ void _Heap_Walk( if (the_block->back_flag != HEAP_DUMMY_FLAG) { printf("PASS: %d Back flag of 1st block isn't HEAP_DUMMY_FLAG\n", source); + error = 1; } while (notdone) { + passes++; + if (error && (passes > 10)) + abort(); + if (do_dump == TRUE) { printf("PASS: %d Block @ 0x%p Back %d, Front %d", source, the_block, @@ -477,6 +484,7 @@ void _Heap_Walk( if ( the_block->front_flag != HEAP_DUMMY_FLAG ) { next_block = _Heap_Next_block(the_block); if ( the_block->front_flag != next_block->back_flag ) { + error = 1; printf("PASS: %d Front and back flags don't match\n", source); printf(" Current Block: Back - %d, Front - %d", the_block->back_flag, the_block->front_flag); @@ -510,4 +518,7 @@ void _Heap_Walk( else the_block = next_block; } + + if (error) + abort(); } |