@@ -1469,19 +1469,17 @@ int jl_gc_classify_pools(size_t sz, int *osize)
14691469// sweep phase
14701470
14711471gc_fragmentation_stat_t gc_page_fragmentation_stats [JL_GC_N_POOLS ];
1472+ JL_DLLEXPORT double jl_gc_page_utilization_stats [JL_GC_N_MAX_POOLS ];
14721473
14731474STATIC_INLINE void gc_update_page_fragmentation_data (jl_gc_pagemeta_t * pg ) JL_NOTSAFEPOINT
14741475{
1475- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14761476 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [pg -> pool_n ];
14771477 jl_atomic_fetch_add (& stats -> n_freed_objs , pg -> nfree );
14781478 jl_atomic_fetch_add (& stats -> n_pages_allocd , 1 );
1479- #endif
14801479}
14811480
14821481STATIC_INLINE void gc_dump_page_utilization_data (void ) JL_NOTSAFEPOINT
14831482{
1484- #ifdef GC_MEASURE_PAGE_FRAGMENTATION
14851483 for (int i = 0 ; i < JL_GC_N_POOLS ; i ++ ) {
14861484 gc_fragmentation_stat_t * stats = & gc_page_fragmentation_stats [i ];
14871485 double utilization = 1.0 ;
@@ -1490,12 +1488,10 @@ STATIC_INLINE void gc_dump_page_utilization_data(void) JL_NOTSAFEPOINT
14901488 if (n_pages_allocd != 0 ) {
14911489 utilization -= ((double )n_freed_objs * (double )jl_gc_sizeclasses [i ]) / (double )n_pages_allocd / (double )GC_PAGE_SZ ;
14921490 }
1493- jl_safe_printf ( "Size class %d: %.2f%% utilization\n" , jl_gc_sizeclasses [i ], utilization * 100.0 ) ;
1491+ jl_gc_page_utilization_stats [i ] = utilization ;
14941492 jl_atomic_store_relaxed (& stats -> n_freed_objs , 0 );
14951493 jl_atomic_store_relaxed (& stats -> n_pages_allocd , 0 );
14961494 }
1497- jl_safe_printf ("-----------------------------------------\n" );
1498- #endif
14991495}
15001496
15011497int64_t buffered_pages = 0 ;
0 commit comments