From d0d357edeb8527becced15e2784b92790d2b22c1 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 25 Jun 2013 12:09:50 +0200 Subject: heap: Add _Heap_Greedy_allocate_all_except_largest Add rtems_workspace_greedy_allocate_all_except_largest() and rtems_heap_greedy_allocate_all_except_largest(). --- cpukit/score/include/rtems/score/heap.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'cpukit/score/include') diff --git a/cpukit/score/include/rtems/score/heap.h b/cpukit/score/include/rtems/score/heap.h index 2937490896..bea9f3ec25 100644 --- a/cpukit/score/include/rtems/score/heap.h +++ b/cpukit/score/include/rtems/score/heap.h @@ -595,7 +595,7 @@ void _Heap_Iterate( /** * @brief Greedy allocate that empties the heap. * - * Afterward the heap has at most @a block_count allocateable blocks of sizes + * Afterwards the heap has at most @a block_count allocatable blocks of sizes * specified by @a block_sizes. The @a block_sizes must point to an array with * @a block_count members. All other blocks are used. * @@ -607,6 +607,20 @@ Heap_Block *_Heap_Greedy_allocate( size_t block_count ); +/** + * @brief Greedy allocate all blocks except the largest free block. + * + * Afterwards the heap has at most one allocatable block. This block is the + * largest free block if it exists. The allocatable size of this block is + * stored in @a allocatable_size. All other blocks are used. + * + * @see _Heap_Greedy_free(). + */ +Heap_Block *_Heap_Greedy_allocate_all_except_largest( + Heap_Control *heap, + uintptr_t *allocatable_size +); + /** * @brief Frees blocks of a greedy allocation. * -- cgit v1.2.3