forked from Imagelibrary/rtems
2009-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/heapallocatealigned.c: Fix spacing.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2009-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* score/src/heapallocatealigned.c: Fix spacing.
|
||||
|
||||
2009-08-05 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* score/src/wkspace.c: Improve debug output.
|
||||
|
||||
@@ -93,8 +93,7 @@ Heap_Block *block_allocate(
|
||||
the_block = _Heap_Block_at(the_block, the_rest);
|
||||
the_block->prev_size = the_rest;
|
||||
the_block->size = alloc_size;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* Don't split the block as remainder is either zero or too small to be
|
||||
used as a separate free block. Change 'alloc_size' to the size of the
|
||||
block and remove the block from the list of free blocks. */
|
||||
@@ -215,13 +214,11 @@ void *_Heap_Allocate_aligned(
|
||||
_Heap_Align_up_uptr(&aligned_user_addr, alignment);
|
||||
if (aligned_user_addr - user_addr >= page_size) {
|
||||
/* No, we can't use the block */
|
||||
aligned_user_addr = 0;
|
||||
goto exit_point;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(aligned_user_addr) {
|
||||
|
||||
/* The block is indeed acceptable: calculate the size of the block
|
||||
to be allocated and perform allocation. */
|
||||
uint32_t const alloc_size =
|
||||
@@ -242,8 +239,8 @@ void *_Heap_Allocate_aligned(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit_point:
|
||||
if (stats->max_search < search_count)
|
||||
stats->max_search = search_count;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user