diff --git a/base/timing.jl b/base/timing.jl index f672123b5a21b..3d1a3a02fe10b 100644 --- a/base/timing.jl +++ b/base/timing.jl @@ -26,6 +26,7 @@ struct GC_Num total_sweep_time ::Int64 total_mark_time ::Int64 last_full_sweep ::Int64 + last_incremental_sweep ::Int64 end gc_num() = ccall(:jl_gc_num, GC_Num, ()) diff --git a/src/gc.c b/src/gc.c index 81d062fae3c3a..e9e26bb748994 100644 --- a/src/gc.c +++ b/src/gc.c @@ -3557,6 +3557,9 @@ static int _jl_gc_collect(jl_ptls_t ptls, jl_gc_collection_t collection) if (sweep_full) { gc_num.last_full_sweep = gc_end_time; } + else { + gc_num.last_incremental_sweep = gc_end_time; + } // sweeping is over // 6. if it is a quick sweep, put back the remembered objects in queued state diff --git a/src/gc.h b/src/gc.h index aa2a0f822666c..cf6580bd69df3 100644 --- a/src/gc.h +++ b/src/gc.h @@ -83,6 +83,7 @@ typedef struct { uint64_t total_sweep_time; uint64_t total_mark_time; uint64_t last_full_sweep; + uint64_t last_incremental_sweep; } jl_gc_num_t; enum {