-
Notifications
You must be signed in to change notification settings - Fork 10
Reloading of nif modules #12
Copy link
Copy link
Open
Description
After a nif module is reloaded, all the nif functions are overwritten by elixir placeholders.
defmodule test_nif do
require Logger
@on_load :init
def init() do
:erlang.load_nif("./priv/test_nif", 0)
:ok
end
def test_a() do
Logger.error "NIF library not loaded"
end
endAfter reloading test_a.beam, test_nif.test_a() will call the placeholder instead of nif functions.
One way I can think of to solve the glitch is to add an _on_reprise_reload() function to test_nif:
def _on_reprise_reload() do
init()
endAnd have reprise call the function after reloading the module
But there might be better ways.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels