Skip to content

Commit

Permalink
Add jl_set_typeinf_func (ex jl_enable_inference)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihnorton committed May 6, 2015
1 parent 90f7cd0 commit 7f52e1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3291,4 +3291,4 @@ end

#tfunc(f,t) = methods(f,t)[1].func.code.tfunc

ccall(:jl_enable_inference, Void, ())
ccall(:jl_set_typeinf_func, Void, (Any,), typeinf_ext)
7 changes: 4 additions & 3 deletions src/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1246,10 +1246,11 @@ DLLEXPORT void julia_save()

jl_function_t *jl_typeinf_func=NULL;

DLLEXPORT void jl_enable_inference(void)
DLLEXPORT void jl_set_typeinf_func(jl_value_t* f)
{
jl_typeinf_func = (jl_function_t*)jl_get_global(jl_base_module,
jl_symbol("typeinf_ext"));
if (!jl_is_function(f))
jl_error("jl_set_typeinf_func must set a jl_function_t*");
jl_typeinf_func = (jl_function_t*)f;
}

static jl_value_t *core(char *name)
Expand Down

0 comments on commit 7f52e1b

Please sign in to comment.