mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-04 03:00:20 +02:00
mmc: Only add headroom to unfragmentable heaps if no progress
This commit is contained in:
parent
140a412ecd
commit
f12399ef7d
1 changed files with 3 additions and 1 deletions
|
@ -586,9 +586,11 @@ grow_heap_if_necessary(struct gc_heap *heap,
|
|||
struct nofl_space *nofl = heap_nofl_space(heap);
|
||||
size_t pending = nofl_space_shrink(nofl, 0);
|
||||
|
||||
// If we cannot defragment and are making no progress but have a
|
||||
// growable heap, expand by 25% to add some headroom.
|
||||
size_t needed_headroom =
|
||||
GC_CONSERVATIVE_TRACE
|
||||
? nofl_active_block_count (nofl) * NOFL_BLOCK_SIZE / 16
|
||||
? (progress ? 0 : nofl_active_block_count (nofl) * NOFL_BLOCK_SIZE / 4)
|
||||
: 0;
|
||||
size_t headroom = nofl_empty_block_count(nofl) * NOFL_BLOCK_SIZE;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue