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

commit eab463bd6c43ce377ab7a2d524e7b9e0b3f9d0ca
Author: Andy Wingo <wi...@igalia.com>
AuthorDate: Thu May 22 14:57:02 2025 +0200

    nofl: Include pending large object allocations in the live data size
---
 src/nofl-space.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/nofl-space.h b/src/nofl-space.h
index 1b28a799b..e9d9efb3c 100644
--- a/src/nofl-space.h
+++ b/src/nofl-space.h
@@ -1067,14 +1067,15 @@ nofl_space_estimate_live_bytes_after_gc(struct 
nofl_space *space,
     nofl_block_count(&space->to_sweep) * NOFL_BLOCK_SIZE * (1 - last_yield);
 
   DEBUG("--- nofl estimate before adjustment: %zu\n", bytes);
-/*
+
   // Assume that if we have pending unavailable bytes after GC that there is a
-  // large object waiting to be allocated, and that probably it survives this 
GC
-  // cycle.
-  bytes += atomic_load_explicit(&space->pending_unavailable_bytes,
-                                memory_order_acquire);
+  // large object waiting to be allocated, so it is practically in the live 
set.
+  ssize_t pending = atomic_load_explicit(&space->pending_unavailable_bytes,
+                                         memory_order_acquire);
+  if (pending > 0)
+    bytes += pending;
   DEBUG("--- nofl estimate after adjustment: %zu\n", bytes);
-*/
+
   return bytes;
 }
 

Reply via email to