diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-24 15:57:29 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2014-03-24 16:00:26 +0100 |
commit | 2a713e3b944625c45154f0ea7f5703e918de758b (patch) | |
tree | c572bfa9e000f7e1fd815d2ab698ac27abf70e7d /cpukit/score/src/heapallocate.c | |
parent | libcsupport: Use POSIX keys for GXX key functions (diff) | |
download | rtems-2a713e3b944625c45154f0ea7f5703e918de758b.tar.bz2 |
score: _Heap_Protection_set_delayed_free_fraction
Add and use _Heap_Protection_set_delayed_free_fraction(). This makes it
possible to avoid a dependency on _Thread_Dispatch_is_enabled().
Diffstat (limited to 'cpukit/score/src/heapallocate.c')
-rw-r--r-- | cpukit/score/src/heapallocate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/score/src/heapallocate.c b/cpukit/score/src/heapallocate.c index f8a4820905..597077e280 100644 --- a/cpukit/score/src/heapallocate.c +++ b/cpukit/score/src/heapallocate.c @@ -34,7 +34,9 @@ { bool search_again = false; uintptr_t const blocks_to_free_count = - (heap->Protection.delayed_free_block_count + 1) / 2; + (heap->Protection.delayed_free_block_count + + heap->Protection.delayed_free_fraction - 1) + / heap->Protection.delayed_free_fraction; if ( alloc_begin == 0 && blocks_to_free_count > 0 ) { Heap_Block *block_to_free = heap->Protection.first_delayed_free_block; |