Skip to content

Commit 3f1e190

Browse files
committed
fix: add upgrade/recompile support
1 parent 32cb0fd commit 3f1e190

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

c_src/emlx_nif.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,16 @@ static int load(ErlNifEnv *env, void **priv_data, ERL_NIF_TERM load_info) {
804804
return 0;
805805
}
806806

807+
int upgrade(ErlNifEnv *env, void **priv_data, void **old_priv_data, ERL_NIF_TERM load_info) {
808+
// Silence "unused var" warnings.
809+
(void)(env);
810+
(void)(priv_data);
811+
(void)(old_priv_data);
812+
(void)(load_info);
813+
814+
return 0;
815+
}
816+
807817
UNARY_OP(abs)
808818
UNARY_OP(ceil)
809819
UNARY_OP(conjugate)
@@ -1147,4 +1157,4 @@ static ErlNifFunc nif_funcs[] = {
11471157
{"call_compiled", 2, call_compiled, ERL_NIF_DIRTY_JOB_CPU_BOUND}};
11481158

11491159
// Update the NIF initialization
1150-
ERL_NIF_INIT(Elixir.EMLX.NIF, nif_funcs, load, NULL, NULL, NULL)
1160+
ERL_NIF_INIT(Elixir.EMLX.NIF, nif_funcs, load, NULL, upgrade, NULL)

0 commit comments

Comments
 (0)