aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-01-04 16:30:04 +0100
committerSverker Eriksson <[email protected]>2018-01-04 20:39:14 +0100
commit22c2151b2823e8d74567e04c63ed2678f85f83cf (patch)
tree244a939607cb6c07ebaefd00f0d13c27c1625dfe
parent19f84054b621aaa9ad05748cc72057726faeda01 (diff)
downloadotp-22c2151b2823e8d74567e04c63ed2678f85f83cf.tar.gz
otp-22c2151b2823e8d74567e04c63ed2678f85f83cf.tar.bz2
otp-22c2151b2823e8d74567e04c63ed2678f85f83cf.zip
erts: Add non fatal big binary creation for test purpose
-rw-r--r--erts/emulator/beam/erl_bif_info.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index 80adca0072..4050fb6146 100644
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -4447,6 +4447,19 @@ BIF_RETTYPE erts_debug_set_internal_state_2(BIF_ALIST_2)
BIF_RET(res);
}
}
+ else if (ERTS_IS_ATOM_STR("binary", BIF_ARG_1)) {
+ Sint64 size;
+ if (term_to_Sint64(BIF_ARG_2, &size)) {
+ Binary* refbin = erts_bin_drv_alloc_fnf(size);
+ if (!refbin)
+ BIF_RET(am_false);
+ sys_memset(refbin->orig_bytes, 0, size);
+ BIF_RET(erts_build_proc_bin(&MSO(BIF_P),
+ HAlloc(BIF_P, PROC_BIN_SIZE),
+ refbin));
+ }
+ }
+
}
BIF_ERROR(BIF_P, BADARG);