diff options
Diffstat (limited to 'cpukit/score/include/rtems/score/heapimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/heapimpl.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/heapimpl.h b/cpukit/score/include/rtems/score/heapimpl.h index abc573de19..a8948edd6f 100644 --- a/cpukit/score/include/rtems/score/heapimpl.h +++ b/cpukit/score/include/rtems/score/heapimpl.h @@ -347,6 +347,29 @@ Heap_Block *_Heap_Block_allocate( } #endif +/** + * @brief Sets the fraction of delayed free blocks that is actually freed + * during memory shortage. + * + * The default is to free half the delayed free blocks. This is equal to a + * fraction value of two. + * + * @param[in] heap The heap control. + * @param[in] fraction The fraction is one divided by this fraction value. + */ +RTEMS_INLINE_ROUTINE void _Heap_Protection_set_delayed_free_fraction( + Heap_Control *heap, + uintptr_t fraction +) +{ +#ifdef HEAP_PROTECTION + heap->Protection.delayed_free_fraction = fraction; +#else + (void) heap; + (void) fraction; +#endif +} + RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_head( Heap_Control *heap ) { return &heap->free_list; |