@@ -1421,19 +1421,17 @@ int jl_gc_classify_pools(size_t sz, int *osize)
14211421// sweep phase
14221422
14231423gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
1424+ JL_DLLEXPORT double gc_page_utilization_stats [JL_GC_N_MAX_POOLS ];
14241425
14251426STATIC_INLINE void gc_update_page_fragmentation_data (jl_gc_pagemeta_t * pg ) JL_NOTSAFEPOINT
14261427{
1427- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14281428 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [pg -> pool_n ];
14291429 jl_atomic_fetch_add (& stats -> n_freed_objs , pg -> nfree );
14301430 jl_atomic_fetch_add (& stats -> n_pages_allocd , 1 );
1431- #endif
14321431}
14331432
14341433STATIC_INLINE void gc_dump_page_utilization_data (void ) JL_NOTSAFEPOINT
14351434{
1436- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14371435 for (int i = 0 ; i < JL_GC_N_POOLS ; i ++ ) {
14381436 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [i ];
14391437 double utilization = 1.0 ;
@@ -1442,12 +1440,10 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
14421440 if (n_pages_allocd != 0 ) {
14431441 utilization -= ((double )n_freed_objs * (double )jl_gc_sizeclasses [i ]) / (double )n_pages_allocd / (double )GC_PAGE_SZ ;
14441442 }
1445- jl_safe_printf ( "Size class %d: %.2f%% utilization\n" , jl_gc_sizeclasses [i ], utilization * 100.0 ) ;
1443+ gc_page_utilization_stats [i ] = utilization ;
14461444 jl_atomic_store_relaxed (& stats -> n_freed_objs , 0 );
14471445 jl_atomic_store_relaxed (& stats -> n_pages_allocd , 0 );
14481446 }
1449- jl_safe_printf ("-----------------------------------------\n" );
1450- #endif
14511447}
14521448
14531449int64_t buffered_pages = 0 ;
0 commit comments