kieraneglin/ex_rtmidi

Audit C++ code for safety

Opened this issue · 0 comments

Related to and blocked by #1

As it stands, I lack the knowledge to gauge the safety of the C++ NIF code. Since a bad NIF can crash the entire Erlang VM, I could use a set of eyes on the C++ code to ensure best practices are followed. A list of (non-exhaustive) issues that come to mind:

  • How should instance destruction be handled?
  • Are the listener-related methods for MIDI input safe? Is the Erlang env being created and freed appropriately?
  • Is the way strings are being handled okay? Mainly around parsing the name of the instance passed from Elixir.

There are many more issues I'm sure but this is what comes to mind.