From c384629a4c64092fa120239e36be098bf2e56c8c Mon Sep 17 00:00:00 2001 From: Yi Lin Date: Tue, 26 Mar 2024 00:48:03 +0000 Subject: [PATCH] Call initialize_collection before enabling GC --- src/init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/init.c b/src/init.c index c11afe6ef5e38..0909d1d88ba06 100644 --- a/src/init.c +++ b/src/init.c @@ -807,10 +807,6 @@ JL_DLLEXPORT void julia_init(JL_IMAGE_SEARCH rel) #pragma GCC diagnostic pop JL_GC_PROMISE_ROOTED(ct); _finish_julia_init(rel, ptls, ct); - -#ifdef MMTK_GC - mmtk_initialize_collection((void *)ptls); -#endif } void jl_init_heartbeat(void); @@ -857,6 +853,9 @@ static NOINLINE void _finish_julia_init(JL_IMAGE_SEARCH rel, jl_ptls_t ptls, jl_ jl_init_heartbeat(); +#ifdef MMTK_GC + mmtk_initialize_collection((void *)ptls); +#endif jl_gc_enable(1); if (jl_options.image_file && (!jl_generating_output() || jl_options.incremental) && jl_module_init_order) {