Skip to content

Commit 304fb39

Browse files
committed
Make sure we init root task before calling perm alloc
1 parent 71329d5 commit 304fb39

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,13 +775,13 @@ JL_DLLEXPORT void jl_init_(jl_image_buf_t sysimage)
775775
// enable before creating the root task so it gets timings too.
776776
jl_atomic_fetch_add(&jl_task_metrics_enabled, 1);
777777
}
778+
// warning: this changes `jl_current_task`, so be careful not to call that from this function
779+
jl_task_t *ct = jl_init_root_task(ptls, stack_lo, stack_hi);
778780
// Initialize constant objects
779781
jl_nothing = jl_gc_permobj(0, jl_nothing_type, 0);
780782
jl_set_typetagof(jl_nothing, jl_nothing_tag, GC_OLD_MARKED);
781783
jl_init_box_caches();
782784
jl_init_common_symbols();
783-
// warning: this changes `jl_current_task`, so be careful not to call that from this function
784-
jl_task_t *ct = jl_init_root_task(ptls, stack_lo, stack_hi);
785785
#pragma GCC diagnostic pop
786786
JL_GC_PROMISE_ROOTED(ct);
787787
_finish_jl_init_(sysimage, ptls, ct);

0 commit comments

Comments
 (0)