Fixed enif_release_resource bug

I was accidentally calling enif_release_resource too many times if the
NIF call had previously yielded back to the Erlang VM. For some reason
this works fine on R14B01 but not on R16B02. The fix was simply to add a
field to the resource struct that tracks if its already been released.

This also changes the target binary allocation to not have to allocate
room for the ErlNifBinary struct since we're adding released flags. This
is a minor performance optimization which avoids a malloc/free call per
encode or decode invocation.
1 file changed
tree: 4cfb9c17ad9e0a9ed8e14cc9561a32a866b30d3f
  1. c_src/
  2. src/
  3. test/
  4. .gitignore
  5. rebar.config