New features of NIF in Erlang/OTP R13B04

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还不成熟,很多功能还在完善中,先别用。。。。等试验期结束后再说。

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值