@@ -1389,21 +1389,19 @@ int jl_gc_classify_pools(size_t sz, int *osize)
13891389// sweep phase
13901390
13911391gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
1392+ JL_DLLEXPORT double jl_gc_page_utilization_stats [JL_GC_N_MAX_POOLS ];
13921393
13931394extern gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
13941395
13951396STATIC_INLINE void gc_update_page_fragmentation_data (jl_gc_pagemeta_t * pg ) JL_NOTSAFEPOINT
13961397{
1397- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
13981398 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [pg -> pool_n ];
13991399 jl_atomic_fetch_add (& stats -> n_freed_objs , pg -> nfree );
14001400 jl_atomic_fetch_add (& stats -> n_pages_allocd , 1 );
1401- #endif
14021401}
14031402
14041403STATIC_INLINE void gc_dump_page_utilization_data (void ) JL_NOTSAFEPOINT
14051404{
1406- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14071405 for (int i = 0 ; i < JL_GC_N_POOLS ; i ++ ) {
14081406 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [i ];
14091407 double utilization = 1.0 ;
@@ -1412,12 +1410,10 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
14121410 if (n_pages_allocd != 0 ) {
14131411 utilization -= ((double )n_freed_objs * (double )jl_gc_sizeclasses [i ]) / (double )n_pages_allocd / (double )GC_PAGE_SZ ;
14141412 }
1415- jl_safe_printf ( "Size class %d: %.2f%% utilization\n" , jl_gc_sizeclasses [i ], utilization * 100.0 ) ;
1413+ jl_gc_page_utilization_stats [i ] = utilization ;
14161414 jl_atomic_store_relaxed (& stats -> n_freed_objs , 0 );
14171415 jl_atomic_store_relaxed (& stats -> n_pages_allocd , 0 );
14181416 }
1419- jl_safe_printf ("-----------------------------------------\n" );
1420- #endif
14211417}
14221418
14231419int64_t buffered_pages = 0 ;
0 commit comments