Allocating memory in Erlang C NIF
1 answer
enif_alloc_resource is used to create resources that are garbage collected by the vm when it is no longer in use. enif_alloc works the same as malloc, only uses the specific Erlang VM implementation, not malloc. Take a look at the documentation for ErlNifResourceType and the functions that use it for more details.
+3
source to share