forked from Imagelibrary/rtems
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libcsupport/src/free.c, libcsupport/src/malloc.c, libcsupport/src/malloc_initialize.c: Remove heap walks in case RTEMS_DEBUG is defined.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
|
* libcsupport/src/free.c, libcsupport/src/malloc.c,
|
||||||
|
libcsupport/src/malloc_initialize.c: Remove heap walks in case
|
||||||
|
RTEMS_DEBUG is defined.
|
||||||
|
|
||||||
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
2010-08-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
|
||||||
|
|
||||||
PR 1672/cpukit
|
PR 1672/cpukit
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ void free(
|
|||||||
if ( !ptr )
|
if ( !ptr )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if defined(RTEMS_HEAP_DEBUG)
|
|
||||||
_Protected_heap_Walk( RTEMS_Malloc_Heap, 0, false );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do not attempt to free memory if in a critical section or ISR.
|
* Do not attempt to free memory if in a critical section or ISR.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -48,13 +48,6 @@ void *malloc(
|
|||||||
!malloc_is_system_state_OK() )
|
!malloc_is_system_state_OK() )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
|
||||||
* Walk the heap and verify its integrity
|
|
||||||
*/
|
|
||||||
#if defined(RTEMS_HEAP_DEBUG)
|
|
||||||
_Protected_heap_Walk( RTEMS_Malloc_Heap, 0, false );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Try to give a segment in the current heap if there is not
|
* Try to give a segment in the current heap if there is not
|
||||||
* enough space then try to grow the heap.
|
* enough space then try to grow the heap.
|
||||||
|
|||||||
@@ -110,15 +110,5 @@ void RTEMS_Malloc_Initialize(
|
|||||||
}
|
}
|
||||||
|
|
||||||
MSBUMP( space_available, _Protected_heap_Get_size(RTEMS_Malloc_Heap) );
|
MSBUMP( space_available, _Protected_heap_Get_size(RTEMS_Malloc_Heap) );
|
||||||
|
|
||||||
#if defined(RTEMS_HEAP_DEBUG)
|
|
||||||
if ( _Protected_heap_Walk( RTEMS_Malloc_Heap, 0, false ) ) {
|
|
||||||
printk( "Malloc heap not initialized correctly\n" );
|
|
||||||
rtems_print_buffer( heap_begin, 32 );
|
|
||||||
printk( "\n" );
|
|
||||||
rtems_print_buffer( (heap_begin + heap_size) - 48, 48 );
|
|
||||||
rtems_fatal_error_occurred( RTEMS_NO_MEMORY );
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user