summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/heapextend.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-06 15:24:08 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-06 15:24:08 +0000
commitdea3eccb38b556b04552219e00b7abd656587278 (patch)
tree6affcb3026172273e366ee15ed3e8ec70f023a20 /cpukit/score/src/heapextend.c
parentRegenerate. (diff)
downloadrtems-dea3eccb38b556b04552219e00b7abd656587278.tar.bz2
2009-09-06 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* libcsupport/src/free.c, libmisc/stackchk/check.c, rtems/include/rtems/rtems/region.h, rtems/src/regioncreate.c, rtems/src/regionextend.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regiongetsegmentsize.c, rtems/src/regionresizesegment.c, score/src/pheapallocate.c, score/src/pheapallocatealigned.c, score/src/pheapextend.c, score/src/pheapfree.c, score/src/pheapgetblocksize.c, score/src/pheapgetfreeinfo.c, score/src/pheapgetinfo.c, score/src/pheapgetsize.c, score/src/pheapinit.c, score/src/pheapresizeblock.c, score/src/pheapwalk.c: Update for heap API changes. * score/include/rtems/score/apimutex.h, score/include/rtems/score/object.h: Documentation. * score/include/rtems/score/heap.h, score/include/rtems/score/protectedheap.h, score/inline/rtems/score/heap.inl, score/src/heap.c, score/src/heapallocate.c, score/src/heapallocatealigned.c, score/src/heapextend.c, score/src/heapfree.c, score/src/heapgetfreeinfo.c, score/src/heapgetinfo.c, score/src/heapresizeblock.c, score/src/heapsizeofuserarea.c, score/src/heapwalk.c: Overall cleanup. Added boundary constraint to allocation function. More changes follow.
Diffstat (limited to 'cpukit/score/src/heapextend.c')
-rw-r--r--cpukit/score/src/heapextend.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/cpukit/score/src/heapextend.c b/cpukit/score/src/heapextend.c
index bb3f301235..3541bddcc9 100644
--- a/cpukit/score/src/heapextend.c
+++ b/cpukit/score/src/heapextend.c
@@ -1,6 +1,12 @@
-/*
- * Heap Handler
+/**
+ * @file
+ *
+ * @ingroup ScoreHeap
*
+ * @brief Heap Handler implementation.
+ */
+
+/*
* COPYRIGHT (c) 1989-1999.
* On-Line Applications Research Corporation (OAR).
*
@@ -28,11 +34,11 @@ Heap_Extend_status _Heap_Extend(
{
Heap_Statistics *const stats = &heap->stats;
uintptr_t const area_begin = (uintptr_t) area_begin_ptr;
- uintptr_t const heap_area_begin = heap->begin;
- uintptr_t const heap_area_end = heap->end;
+ uintptr_t const heap_area_begin = heap->area_begin;
+ uintptr_t const heap_area_end = heap->area_end;
uintptr_t const new_heap_area_end = heap_area_end + area_size;
uintptr_t extend_size = 0;
- Heap_Block *const old_final = heap->final;
+ Heap_Block *const old_final = heap->last_block;
Heap_Block *new_final = NULL;
/*
@@ -60,10 +66,10 @@ Heap_Extend_status _Heap_Extend(
* block and free it.
*/
- heap->end = new_heap_area_end;
+ heap->area_end = new_heap_area_end;
extend_size = new_heap_area_end
- - (uintptr_t) old_final - HEAP_LAST_BLOCK_OVERHEAD;
+ - (uintptr_t) old_final - HEAP_BLOCK_HEADER_SIZE;
extend_size = _Heap_Align_down( extend_size, heap->page_size );
*amount_extended = extend_size;
@@ -74,7 +80,7 @@ Heap_Extend_status _Heap_Extend(
new_final = _Heap_Block_at( old_final, extend_size );
new_final->size_and_flag = heap->page_size | HEAP_PREV_BLOCK_USED;
- heap->final = new_final;
+ heap->last_block = new_final;
stats->size += area_size;
++stats->used_blocks;