Why doesn't Erlang have a C NIF replacement for calloc?

Why is Erlang C NIF substitute for malloc

, enif_alloc

but is not calloc

? Thus, forcing use memset()

after enif_alloc

to access the array.

+3


source to share


1 answer


Well, I suppose it has something to do with the fact (from the documentation):

"NIF introduced in R13B03 as an experimental feature.

On the other hand, the Erlang overview board is also quite conservative, probably due to the birth history of the telelcom company, and this is understandable for fault-tolerant languages.



I think I don't see the problem with which you can always write the correct port with calloc () and use the old marshaling methods. http://www.erlang.org/doc/tutorial/erl_interface.html

Happy C coding!

+2


source







All Articles