wingo pushed a commit to branch wip-whippet
in repository guile.

commit 1358d99abc2673ba865bbd9604712ddb3e79af51
Author: Andy Wingo <[email protected]>
AuthorDate: Tue Aug 2 22:15:13 2022 +0200

    Fix yield calculation after evacuating collections
---
 whippet.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/whippet.h b/whippet.h
index 644b4eeb2..cd2c18af0 100644
--- a/whippet.h
+++ b/whippet.h
@@ -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;
 }
 

Reply via email to