mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-03 18:50:19 +02:00
Adapt to whippet change
This commit is contained in:
parent
a344c225c4
commit
0ffa6688aa
1 changed files with 5 additions and 5 deletions
|
@ -65,7 +65,6 @@
|
||||||
|
|
||||||
struct scm_gc_event_listener {
|
struct scm_gc_event_listener {
|
||||||
struct gc_basic_stats stats;
|
struct gc_basic_stats stats;
|
||||||
uint64_t last_allocation_counter;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct scm_gc_event_listener_mutator {
|
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;
|
struct scm_gc_event_listener *scm_listener = data;
|
||||||
gc_basic_stats_mutators_stopped (&scm_listener->stats);
|
gc_basic_stats_mutators_stopped (&scm_listener->stats);
|
||||||
scm_c_hook_run (&scm_before_gc_c_hook, NULL);
|
scm_c_hook_run (&scm_before_gc_c_hook, NULL);
|
||||||
scm_listener->last_allocation_counter = gc_allocation_counter (the_gc_heap);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
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;
|
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
|
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;
|
uint64_t gc_time_taken = data.stats.cpu_collector_usec * scale_usecs;
|
||||||
size_t heap_size = data.stats.heap_size;
|
size_t heap_size = data.stats.heap_size;
|
||||||
uint64_t total_bytes = gc_allocation_counter (the_gc_heap);
|
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;
|
ssize_t free_bytes = heap_size - data.stats.live_data_size;
|
||||||
free_bytes -= bytes_since_gc;
|
free_bytes -= bytes_since_gc;
|
||||||
if (free_bytes < 0)
|
if (free_bytes < 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue