aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bif_load.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-12-03 15:42:02 +0100
committerBjörn Gustavsson <[email protected]>2016-02-25 14:53:10 +0100
commit272985d3d1b36833ebd586e5f051ac3a4ab0cd91 (patch)
treecc60594d05d2af06d35175a2797ed602a77358d9 /erts/emulator/beam/beam_bif_load.c
parent8f4c278b69fe4d613a0b865a2edac43231cad913 (diff)
downloadotp-272985d3d1b36833ebd586e5f051ac3a4ab0cd91.tar.gz
otp-272985d3d1b36833ebd586e5f051ac3a4ab0cd91.tar.bz2
otp-272985d3d1b36833ebd586e5f051ac3a4ab0cd91.zip
Add has_prepared_code_on_load/1 BIF
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r--erts/emulator/beam/beam_bif_load.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index d426b6eebb..0b47fc3586 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -139,6 +139,25 @@ prepare_loading_2(BIF_ALIST_2)
BIF_RET(res);
}
+BIF_RETTYPE
+has_prepared_code_on_load_1(BIF_ALIST_1)
+{
+ Eterm res;
+ ProcBin* pb;
+
+ if (!ERTS_TERM_IS_MAGIC_BINARY(BIF_ARG_1)) {
+ error:
+ BIF_ERROR(BIF_P, BADARG);
+ }
+
+ pb = (ProcBin*) binary_val(BIF_ARG_1);
+ res = erts_has_code_on_load(pb->val);
+ if (res == NIL) {
+ goto error;
+ }
+ BIF_RET(res);
+}
+
struct m {
Binary* code;
Eterm module;