From: http://archive.netbsd.se/?ml=erlang-questions&a=2009-12&m=12044883
Some new NIF features pre-released on http://github.com/erlang/otp
(branch ccase/r13b04_dev):
INCOMPATIBLE changes:
* Function prototypes of all NIFs changed to argc-argv style:
ERL_NIF_TERM my_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
The purpose is to allow more than 3 function arguments but it's also turns out to be good for performance.
You need to go through all your NIFs and change the function prototype as well as refer to argv[N-1] (for the Nth argument) instead of named argument variables.
* erlang:load_nif has changed return value on failure from {error,A,S} to {error,{A,S}}
New API functions:
enif_make_double, enif_get_double
enif_make_ref, enif_is_ref
enif_make_existing_atom
enif_is_atom
enif_is_identical
enif_compare
enif_get_tuple
Read more in erts/doc/src/erl_nif.xml.
/Sverker, Erlang/OTP Ericsson
感觉NIF还不成熟,很多功能还在完善中,先别用。。。。等试验期结束后再说。
Erlang NIF 接口进行了预发布更新,引入了新的 API 函数,并对现有功能进行了调整,如改变了所有 NIF 函数原型为 argc-argv 样式,改进了 erlang:load_nif 的错误返回格式。
190

被折叠的 条评论
为什么被折叠?



