diff options
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. |