diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-25 12:09:50 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-25 17:03:22 +0200 |
commit | d0d357edeb8527becced15e2784b92790d2b22c1 (patch) | |
tree | 64985dad8d48fe6b888a7d4faaf3b3cc18c6c7d5 /cpukit/libcsupport/include/rtems/malloc.h | |
parent | heap: Free all delayed blocks during resize (diff) | |
download | rtems-d0d357edeb8527becced15e2784b92790d2b22c1.tar.bz2 |
heap: Add _Heap_Greedy_allocate_all_except_largest
Add rtems_workspace_greedy_allocate_all_except_largest() and
rtems_heap_greedy_allocate_all_except_largest().
Diffstat (limited to 'cpukit/libcsupport/include/rtems/malloc.h')
-rw-r--r-- | cpukit/libcsupport/include/rtems/malloc.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/cpukit/libcsupport/include/rtems/malloc.h b/cpukit/libcsupport/include/rtems/malloc.h index c428bcffb2..25a2e4ea50 100644 --- a/cpukit/libcsupport/include/rtems/malloc.h +++ b/cpukit/libcsupport/include/rtems/malloc.h @@ -224,7 +224,7 @@ rtems_status_code rtems_heap_extend( /** * @brief Greedy allocate that empties the heap. * - * Afterward the heap has at most @a block_count allocatable 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. * @@ -236,10 +236,24 @@ void *rtems_heap_greedy_allocate( ); /** + * @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 rtems_heap_greedy_free(). + */ +void *rtems_heap_greedy_allocate_all_except_largest( + uintptr_t *allocatable_size +); + +/** * @brief Frees space of a greedy allocation. * * The @a opaque argument must be the return value of - * rtems_heap_greedy_allocate(). + * rtems_heap_greedy_allocate() or + * rtems_heap_greedy_allocate_all_except_largest(). */ void rtems_heap_greedy_free( void *opaque ); |