uses address object rather than direct pointer arithmetic

This commit is contained in:
Joel Sherrill
1996-09-18 20:50:27 +00:00
parent 4944b5bfe5
commit 3861130b35
2 changed files with 6 additions and 4 deletions

View File

@@ -149,7 +149,8 @@ Heap_Extend_status _Heap_Extend(
} else { /* cases 4 and 5 */
the_block = (Heap_Block *) (starting_address - HEAP_OVERHEAD);
the_block = (Heap_Block *)
_Addresses_Subtract_offset( starting_address, HEAP_OVERHEAD );
if ( the_block != the_heap->final )
return HEAP_EXTEND_NOT_IMPLEMENTED; /* case 5 */
}
@@ -258,7 +259,7 @@ void *_Heap_Allocate(
*/
offset = the_heap->page_size - (((unsigned32) ptr) & (the_heap->page_size - 1));
ptr += offset;
ptr = _Addresses_Add_offset( ptr, offset );
*(((unsigned32 *) ptr) - 1) = offset;
#ifdef RTEMS_DEBUG