aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
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
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')
-rw-r--r--erts/emulator/beam/beam_bif_load.c19
-rw-r--r--erts/emulator/beam/bif.tab1
2 files changed, 20 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;
diff --git a/erts/emulator/beam/bif.tab b/erts/emulator/beam/bif.tab
index 4efc055aaf..5c84b9c0eb 100644
--- a/erts/emulator/beam/bif.tab
+++ b/erts/emulator/beam/bif.tab
@@ -649,6 +649,7 @@ bif binary:split/2
bif binary:split/3
bif erts_debug:size_shared/1
bif erts_debug:copy_shared/1
+bif erlang:has_prepared_code_on_load/1
#
# Obsolete