Skip to content

Commit 60423e2

Browse files
authored
precompile methods marked ccallable (#42153)
1 parent 8db1d89 commit 60423e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/precompile.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ static int precompile_enq_specialization_(jl_method_instance_t *mi, void *closur
344344
static int precompile_enq_all_specializations__(jl_typemap_entry_t *def, void *closure)
345345
{
346346
jl_method_t *m = def->func.method;
347-
if (m->name == jl_symbol("__init__") && jl_is_dispatch_tupletype(m->sig)) {
348-
// ensure `__init__()` gets strongly-hinted, specialized, and compiled
347+
if ((m->name == jl_symbol("__init__") || m->ccallable) && jl_is_dispatch_tupletype(m->sig)) {
348+
// ensure `__init__()` and @ccallables get strongly-hinted, specialized, and compiled
349349
jl_method_instance_t *mi = jl_specializations_get_linfo(m, m->sig, jl_emptysvec);
350350
jl_array_ptr_1d_push((jl_array_t*)closure, (jl_value_t*)mi);
351351
}

0 commit comments

Comments
 (0)