Changeset 1f49f77 in rtems


Ignore:
Timestamp:
Sep 7, 2007, 9:42:14 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
fb61b0fe
Parents:
5ae327b
Message:

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

  • libcsupport/src/malloc.c: If RTEMS_HEAP_DEBUG is defined, add heap walk on init, malloc, and free. The ability to walk the heap appears to disappeared during the rework of the C Program heap to skip the Region.
Location:
cpukit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r5ae327b r1f49f77  
     12007-09-07      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * libcsupport/src/malloc.c: If RTEMS_HEAP_DEBUG is defined, add heap
     4        walk on init, malloc, and free. The ability to walk the heap appears
     5        to disappeared during the rework of the C Program heap to skip the
     6        Region.
     7
    182007-09-07      Joel Sherrill <joel.sherrill@oarcorp.com>
    29
  • cpukit/libcsupport/src/malloc.c

    r5ae327b r1f49f77  
    6565    ind += sprintf(cbuf+ind, "Malloc Error: %s\n", msg);
    6666    if ((mp->forw->back != mp) || (mp->back->forw != mp))
    67         ind += sprintf(cbuf+ind, "mp:0x%x  mp->forw:0x%x  mp->forw->back:0x%x  mp->back:0x%x  mp->back->forw:0x%x\n",
    68                         mp, mp->forw, mp->forw->back, mp->back, mp->back->forw);
     67        ind += sprintf(cbuf+ind,
     68            "mp:0x%x  mp->forw:0x%x  mp->forw->back:0x%x  "
     69            "mp->back:0x%x  mp->back->forw:0x%x\n",
     70            mp, mp->forw, mp->forw->back, mp->back, mp->back->forw);
    6971    if (mp->memory != (mp + 1))
    7072        ind += sprintf(cbuf+ind, "mp+1:0x%x  ", mp + 1);
     
    193195    rtems_fatal_error_occurred( status );
    194196
     197  #if defined(RTEMS_HEAP_DEBUG)
     198    if ( _Protected_heap_Walk( &RTEMS_Malloc_Heap, 0, FALSE ) ) {
     199      printk( "Malloc heap not initialized correctly\n" );
     200      rtems_print_buffer( start, 32 );
     201      printk( "\n" );
     202      rtems_print_buffer( (start + length) - 48, 48 );
     203      rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
     204    }
     205  #endif
    195206#ifdef MALLOC_STATS
    196207  /* zero all the stats */
     
    216227  if ( !size )
    217228    return (void *) 0;
     229
     230  #if defined(RTEMS_HEAP_DEBUG)
     231    _Protected_heap_Walk( &RTEMS_Malloc_Heap, 0, FALSE );
     232  #endif
    218233
    219234  /*
     
    429444  if ( !ptr )
    430445    return;
     446
     447  #if defined(RTEMS_HEAP_DEBUG)
     448    _Protected_heap_Walk( &RTEMS_Malloc_Heap, 0, FALSE );
     449  #endif
    431450
    432451  /*
Note: See TracChangeset for help on using the changeset viewer.