Changeset 55d7626 in rtems for cpukit/score/src/heapfree.c


Ignore:
Timestamp:
07/11/07 20:56:10 (15 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
9190d236
Parents:
68b9f58
Message:

2007-07-11 Joel Sherrill <joel.sherrill@…>

  • 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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/heapfree.c

    r68b9f58 r55d7626  
    22 *  Heap Handler
    33 *
    4  *  COPYRIGHT (c) 1989-1999.
     4 *  COPYRIGHT (c) 1989-2007.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    4141)
    4242{
    43   Heap_Block        *the_block;
    44   Heap_Block        *next_block;
     43  Heap_Block      *the_block;
     44  Heap_Block      *next_block;
    4545  uint32_t         the_size;
    4646  uint32_t         next_size;
    4747  Heap_Statistics *const stats = &the_heap->stats;
    48   boolean            next_is_free;
     48  boolean          next_is_free;
     49
     50  if ( !_Addresses_Is_in_range(
     51       starting_address, (void *)the_heap->start, (void *)the_heap->final ) ) {
     52    _HAssert(starting_address != NULL);
     53    return( FALSE );
     54  }
    4955
    5056  _Heap_Start_of_block( the_heap, starting_address, &the_block );
    5157
    5258  if ( !_Heap_Is_block_in( the_heap, the_block ) ) {
    53     _HAssert(starting_address == NULL);
    54     _HAssert(FALSE);
     59    _HAssert( FALSE );
    5560    return( FALSE );
    5661  }
     
    6065
    6166  if ( !_Heap_Is_block_in( the_heap, next_block ) ) {
    62     _HAssert(FALSE);
     67    _HAssert( FALSE );
    6368    return( FALSE );
    6469  }
    6570
    6671  if ( !_Heap_Is_prev_used( next_block ) ) {
    67     _HAssert(FALSE);
     72    _HAssert( FALSE );
    6873    return( FALSE );
    6974  }
     
    7883
    7984    if ( !_Heap_Is_block_in( the_heap, prev_block ) ) {
    80       _HAssert(FALSE);
     85      _HAssert( FALSE );
    8186      return( FALSE );
    8287    }
     
    8590       must have been used. */
    8691    if ( !_Heap_Is_prev_used ( prev_block) ) {
    87       _HAssert(FALSE);
     92      _HAssert( FALSE );
    8893      return( FALSE );
    8994    }
Note: See TracChangeset for help on using the changeset viewer.