@@ -1398,21 +1398,19 @@ int jl_gc_classify_pools(size_t sz, int *osize)
13981398// sweep phase
13991399
14001400gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
1401+ JL_DLLEXPORT double jl_gc_page_utilization_stats [JL_GC_N_MAX_POOLS ];
14011402
14021403extern gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
14031404
14041405STATIC_INLINE void gc_update_page_fragmentation_data (jl_gc_pagemeta_t * pg ) JL_NOTSAFEPOINT
14051406{
1406- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14071407 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [pg -> pool_n ];
14081408 jl_atomic_fetch_add (& stats -> n_freed_objs , pg -> nfree );
14091409 jl_atomic_fetch_add (& stats -> n_pages_allocd , 1 );
1410- #endif
14111410}
14121411
14131412STATIC_INLINE void gc_dump_page_utilization_data (void ) JL_NOTSAFEPOINT
14141413{
1415- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14161414 for (int i = 0 ; i < JL_GC_N_POOLS ; i ++ ) {
14171415 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [i ];
14181416 double utilization = 1.0 ;
@@ -1421,12 +1419,10 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
14211419 if (n_pages_allocd != 0 ) {
14221420 utilization -= ((double )n_freed_objs * (double )jl_gc_sizeclasses [i ]) / (double )n_pages_allocd / (double )GC_PAGE_SZ ;
14231421 }
1424- jl_safe_printf ( "Size class %d: %.2f%% utilization\n" , jl_gc_sizeclasses [i ], utilization * 100.0 ) ;
1422+ jl_gc_page_utilization_stats [i ] = utilization ;
14251423 jl_atomic_store_relaxed (& stats -> n_freed_objs , 0 );
14261424 jl_atomic_store_relaxed (& stats -> n_pages_allocd , 0 );
14271425 }
1428- jl_safe_printf ("-----------------------------------------\n" );
1429- #endif
14301426}
14311427
14321428int64_t buffered_pages = 0 ;
0 commit comments