Last active
December 22, 2015 07:08
-
-
Save krestenkrab/6435896 to your computer and use it in GitHub Desktop.
Erjang/NIF interop First time ever calling a real NIF from Erjang. The nif .so is not recompiled specifically for Erjang.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
krab$ ../ej | |
** Erjang R15B03 ** [root:/usr/local/lib/erlang] [erts:5.9.3.1] [unicode] | |
Eshell V5.9.3.1 (abort with ^G) | |
1> erlang:load_nif("/Users/krab/Projects/riak/deps/bitcask/priv/bitcask.so", any). | |
ok | |
2> {ok,KeyDir} = bitcask_nifs:keydir_new(). | |
{ok,<<>>} | |
3> bitcask_nifs:keydir_put_int(KeyDir, <<"key">>, 2, 100, <<123:64>>, 2222, 3333, 3, <<123:64>>). | |
already_exists | |
4> bitcask_nifs:keydir_put_int(KeyDir, <<"key">>, 2, 100, <<123:64>>, 2222, 3333, 0, <<123:64>>). | |
ok | |
5> bitcask_nifs:keydir_info(KeyDir). | |
{1,3, | |
[{2,1,1,100,100,2222,2222}], | |
{<<0,0,0,0,0,0,0,0>>,0,false}} | |
6> bitcask_nifs:keydir_get_int(KeyDir, <<"key">>). | |
{bitcask_entry,<<"key">>,2,100,<<0,0,0,0,0,0,0,123>>,2222} | |
7> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment