diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-06-07 09:35:01 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2010-06-07 09:35:01 +0000 |
commit | b2a0214d4395787eca8e74375d283bf26c9ca4a1 (patch) | |
tree | eb91086d7da6342ea88ad774939bb90afcfd3e4f /cpukit/score/inline/rtems/score/heap.inl | |
parent | 2010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de> (diff) | |
download | rtems-b2a0214d4395787eca8e74375d283bf26c9ca4a1.tar.bz2 |
2010-06-07 Sebastian Huber <sebastian.huber@embedded-brains.de>
* score/include/rtems/score/heap.h: Declare
_Heap_Get_first_and_last_block(). Removed Heap_Extend_status.
Changed return type of _Heap_Extend() to bool.
* score/inline/rtems/score/heap.inl: Define
_Heap_Set_last_block_size().
* score/src/heap.c: Define and use _Heap_Get_first_and_last_block().
* score/src/heapgetinfo.c: Removed assert statements. Do not count
the last block. This ensures that all size values are an integral
multiple of the page size which is consistent with the other
statistics.
* score/src/heapextend.c: Implemented support for scattered heap
areas.
* score/src/heapwalk.c: Dump also last block. Changes for new first
and last block values.
* ./score/src/pheapextend.c, rtems/src/regionextend.c: Update for
_Heap_Extend() changes.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/inline/rtems/score/heap.inl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cpukit/score/inline/rtems/score/heap.inl b/cpukit/score/inline/rtems/score/heap.inl index 0f14a0b245..50fb16a55c 100644 --- a/cpukit/score/inline/rtems/score/heap.inl +++ b/cpukit/score/inline/rtems/score/heap.inl @@ -200,6 +200,24 @@ RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( } /** + * @brief Sets the size of the last block for heap @a heap. + * + * The next block of the last block will be the first block. Since the first + * block indicates that the previous block is used, this ensures that the last + * block appears as used for the _Heap_Is_used() and _Heap_Is_free() functions. + * + * This feature will be used to terminate the scattered heap area list. See + * also _Heap_Extend(). + */ +RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) +{ + _Heap_Block_set_size( + heap->last_block, + (uintptr_t) heap->first_block - (uintptr_t) heap->last_block + ); +} + +/** * @brief Returns the size of the allocatable area in bytes. * * This value is an integral multiple of the page size. |