diff options
author | Andy Wingo <wingo@pobox.com> | 2025-05-16 22:27:20 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2025-05-16 22:27:20 +0200 |
commit | 0ffa6688aa5c19348a0a674d0d8a553b29dd9df8 (patch) | |
tree | 4350d7802429fa8d80f7d43fb7c639181b10621a | |
parent | a344c225c4832856a1f44de16ade2971dcbd01ec (diff) | |
download | guile-0ffa6688aa5c19348a0a674d0d8a553b29dd9df8.tar.gz |
Adapt to whippet change
-rw-r--r-- | libguile/gc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/gc.c b/libguile/gc.c index 1270b368f..abdfffc32 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -65,7 +65,6 @@ struct scm_gc_event_listener { struct gc_basic_stats stats; - uint64_t last_allocation_counter; }; struct scm_gc_event_listener_mutator { @@ -144,14 +143,14 @@ scm_gc_event_listener_mutators_stopped (void *data) struct scm_gc_event_listener *scm_listener = data; gc_basic_stats_mutators_stopped (&scm_listener->stats); scm_c_hook_run (&scm_before_gc_c_hook, NULL); - scm_listener->last_allocation_counter = gc_allocation_counter (the_gc_heap); } static inline void -scm_gc_event_listener_prepare_gc (void *data, enum gc_collection_kind kind) +scm_gc_event_listener_prepare_gc (void *data, enum gc_collection_kind kind, + uint64_t allocation_counter) { struct scm_gc_event_listener *scm_listener = data; - gc_basic_stats_prepare_gc (&scm_listener->stats, kind); + gc_basic_stats_prepare_gc (&scm_listener->stats, kind, allocation_counter); } static inline void @@ -358,7 +357,8 @@ SCM_DEFINE (scm_gc_stats, "gc-stats", 0, 0, 0, uint64_t gc_time_taken = data.stats.cpu_collector_usec * scale_usecs; size_t heap_size = data.stats.heap_size; uint64_t total_bytes = gc_allocation_counter (the_gc_heap); - uint64_t bytes_since_gc = total_bytes - data.last_allocation_counter; + uint64_t bytes_since_gc = + total_bytes - data.stats.allocation_counter_at_last_gc; ssize_t free_bytes = heap_size - data.stats.live_data_size; free_bytes -= bytes_since_gc; if (free_bytes < 0) |