diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-06-11 23:27:06 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-07-11 16:55:07 +0200 |
commit | e1f903d5210fb5b91ff47229fb57bf3b0edeb79e (patch) | |
tree | 8914b206c75b8cb918a523436a220c670cbd34e3 /erts/emulator/beam/erl_bif_info.c | |
parent | 9a1419a7d4325085dc2235a8531d77e1d96ea689 (diff) | |
download | otp-e1f903d5210fb5b91ff47229fb57bf3b0edeb79e.tar.gz otp-e1f903d5210fb5b91ff47229fb57bf3b0edeb79e.tar.bz2 otp-e1f903d5210fb5b91ff47229fb57bf3b0edeb79e.zip |
erts: Introduce erlang:fun_info_mfa/1
Introduced for proc_lib:init_p/3
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_info.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c index 4d5e55aaf5..faa2655c11 100644 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -3055,6 +3055,25 @@ fun_info_2(BIF_ALIST_2) return TUPLE2(hp, what, val); } +BIF_RETTYPE +fun_info_mfa_1(BIF_ALIST_1) +{ + Process* p = BIF_P; + Eterm fun = BIF_ARG_1; + Eterm* hp; + + if (is_fun(fun)) { + ErlFunThing* funp = (ErlFunThing *) fun_val(fun); + hp = HAlloc(p, 4); + BIF_RET(TUPLE3(hp,funp->fe->module,funp->fe->address[-2],make_small(funp->arity))); + } else if (is_export(fun)) { + Export* exp = (Export *) ((UWord) (export_val(fun))[1]); + hp = HAlloc(p, 4); + BIF_RET(TUPLE3(hp,exp->code[0],exp->code[1],make_small(exp->code[2]))); + } + BIF_ERROR(p, BADARG); +} + BIF_RETTYPE is_process_alive_1(BIF_ALIST_1) { if(is_internal_pid(BIF_ARG_1)) { |