From 374232678b8323b871af7c4ed6c9b826002cad62 Mon Sep 17 00:00:00 2001 From: Zentrik Date: Thu, 4 Jan 2024 11:56:08 +0000 Subject: [PATCH] Only run GC 3 times instead of 4 to scrub (#350) * Only run GC 3 times instead of 4 to scrub Per slack, 'Diogo changed it so it only needs 3 to promote everything to old generation now'. * Still run gc 4 times on older Julia versions * Format --- src/execution.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/execution.jl b/src/execution.jl index a031e652..ab7dbc42 100644 --- a/src/execution.jl +++ b/src/execution.jl @@ -1,7 +1,14 @@ # Trigger several successive GC sweeps. This is more comprehensive than running just a # single sweep, since freeable objects may need more than one sweep to be appropriately # marked and freed. -gcscrub() = (GC.gc(); GC.gc(); GC.gc(); GC.gc()) +function gcscrub() + GC.gc() + GC.gc() + GC.gc() + @static if VERSION < v"1.10" + GC.gc() + end +end ############# # Benchmark #