mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-31 03:38:46 +08:00
Delete _Region_Debug_Walk()
The expensive heap walks are superfluous due to the heap protection enabled via RTEMS_DEBUG. Update #2477.
This commit is contained in:
@@ -146,26 +146,6 @@ RTEMS_INLINE_ROUTINE bool _Region_Free_segment (
|
||||
*/
|
||||
extern void _Region_Process_queue(Region_Control *the_region);
|
||||
|
||||
/**
|
||||
* @brief _Region_Debug_Walk
|
||||
*
|
||||
* This routine is invoked to verify the integrity of a heap associated
|
||||
* with the_region.
|
||||
*/
|
||||
#ifdef RTEMS_DEBUG
|
||||
|
||||
#define _Region_Debug_Walk( _the_region, _source ) \
|
||||
do { \
|
||||
if ( rtems_debug_is_enabled( RTEMS_DEBUG_REGION ) ) \
|
||||
_Heap_Walk( &(_the_region)->Memory, _source, false ); \
|
||||
} while ( 0 )
|
||||
|
||||
#else
|
||||
|
||||
#define _Region_Debug_Walk( _the_region, _source )
|
||||
|
||||
#endif
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -40,7 +40,6 @@ rtems_status_code rtems_region_delete(
|
||||
switch ( location ) {
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
_Region_Debug_Walk( the_region, 5 );
|
||||
if ( the_region->number_of_used_blocks != 0 )
|
||||
return_status = RTEMS_RESOURCE_IN_USE;
|
||||
else {
|
||||
|
||||
@@ -57,12 +57,8 @@ rtems_status_code rtems_region_get_segment(
|
||||
return_status = RTEMS_INVALID_SIZE;
|
||||
|
||||
else {
|
||||
_Region_Debug_Walk( the_region, 1 );
|
||||
|
||||
the_segment = _Region_Allocate_segment( the_region, size );
|
||||
|
||||
_Region_Debug_Walk( the_region, 2 );
|
||||
|
||||
if ( the_segment ) {
|
||||
the_region->number_of_used_blocks += 1;
|
||||
*segment = the_segment;
|
||||
|
||||
@@ -49,9 +49,6 @@ rtems_status_code rtems_region_resize_segment(
|
||||
switch ( location ) {
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
_Region_Debug_Walk( the_region, 7 );
|
||||
|
||||
status = _Heap_Resize_block(
|
||||
&the_region->Memory,
|
||||
segment,
|
||||
@@ -61,8 +58,6 @@ rtems_status_code rtems_region_resize_segment(
|
||||
);
|
||||
*old_size = (uint32_t) osize;
|
||||
|
||||
_Region_Debug_Walk( the_region, 8 );
|
||||
|
||||
if ( status == HEAP_RESIZE_SUCCESSFUL )
|
||||
/* unlocks allocator */
|
||||
_Region_Process_queue( the_region );
|
||||
|
||||
@@ -53,9 +53,6 @@ rtems_status_code rtems_region_return_segment(
|
||||
switch ( location ) {
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
_Region_Debug_Walk( the_region, 3 );
|
||||
|
||||
#ifdef RTEMS_REGION_FREE_SHRED_PATTERN
|
||||
if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, &size ) )
|
||||
return_status = RTEMS_INVALID_ADDRESS;
|
||||
@@ -64,8 +61,6 @@ rtems_status_code rtems_region_return_segment(
|
||||
#endif
|
||||
status = _Region_Free_segment( the_region, segment );
|
||||
|
||||
_Region_Debug_Walk( the_region, 4 );
|
||||
|
||||
if ( !status )
|
||||
return_status = RTEMS_INVALID_ADDRESS;
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user