Prefer binary realloc to self-managed buffers
Use erlang's allocator and simplify the code by writing into the buffer we're going to give back anyway. Also introduce a function to NUL-terminate iolist buffers, which can avoid memory copying.
This commit is contained in:
@@ -40,7 +40,6 @@ geef_commit_tree(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[])
|
||||
term_obj = enif_make_resource(env, obj);
|
||||
enif_release_resource(obj);
|
||||
|
||||
|
||||
return enif_make_tuple3(env, atoms.ok, atoms.tree, term_obj);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user