mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-12 16:50:22 +02:00
Fix yield calculation after evacuating collections
This commit is contained in:
parent
a4e1f55f37
commit
1358d99abc
1 changed files with 4 additions and 1 deletions
|
@ -1153,11 +1153,14 @@ static double heap_last_gc_yield(struct heap *heap) {
|
|||
struct mark_space *mark_space = heap_mark_space(heap);
|
||||
size_t mark_space_yield = mark_space->granules_freed_by_last_collection;
|
||||
mark_space_yield <<= GRANULE_SIZE_LOG_2;
|
||||
size_t evacuation_block_yield =
|
||||
atomic_load_explicit(&mark_space->evacuation_targets.count,
|
||||
memory_order_acquire) * BLOCK_SIZE;
|
||||
struct large_object_space *lospace = heap_large_object_space(heap);
|
||||
size_t lospace_yield = lospace->pages_freed_by_last_collection;
|
||||
lospace_yield <<= lospace->page_size_log2;
|
||||
|
||||
double yield = mark_space_yield + lospace_yield;
|
||||
double yield = mark_space_yield + lospace_yield + evacuation_block_yield;
|
||||
return yield / heap->size;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue