Skip to content

Commit 1ea4941

Browse files
qinsoonudesou
authored andcommitted
Export pool stats
1 parent dd61b98 commit 1ea4941

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/gc-stock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,7 @@ int jl_gc_classify_pools(size_t sz, int *osize)
826826

827827
gc_fragmentation_stat_t gc_page_fragmentation_stats[JL_GC_N_POOLS];
828828
JL_DLLEXPORT double jl_gc_page_utilization_stats[JL_GC_N_MAX_POOLS];
829+
JL_DLLEXPORT gc_fragmentation_stat_t jl_gc_page_fragmentation_stats_export[JL_GC_N_POOLS];
829830

830831
STATIC_INLINE void gc_update_page_fragmentation_data(jl_gc_pagemeta_t *pg) JL_NOTSAFEPOINT
831832
{
@@ -845,6 +846,8 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
845846
utilization -= ((double)n_freed_objs * (double)jl_gc_sizeclasses[i]) / (double)n_pages_allocd / (double)GC_PAGE_SZ;
846847
}
847848
jl_gc_page_utilization_stats[i] = utilization;
849+
jl_gc_page_fragmentation_stats_export[i].n_freed_objs = n_freed_objs;
850+
jl_gc_page_fragmentation_stats_export[i].n_pages_allocd = n_pages_allocd;
848851
jl_atomic_store_relaxed(&stats->n_freed_objs, 0);
849852
jl_atomic_store_relaxed(&stats->n_pages_allocd, 0);
850853
}

0 commit comments

Comments
 (0)