diff options
author | Sverker Eriksson <[email protected]> | 2018-01-15 20:45:34 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-01-15 20:45:34 +0100 |
commit | f359cffc2590848c9ea4ff366d550c1351569479 (patch) | |
tree | 1c81ee58a804de478a0e96eae3e9b8e72cb8a11c /erts/emulator/beam/erl_bif_info.c | |
parent | fd30cdac0f62c70336330d94ac944bb110932cc2 (diff) | |
parent | 0e448a62f46df4dad55c3bc724448e80a4d0048c (diff) | |
download | otp-f359cffc2590848c9ea4ff366d550c1351569479.tar.gz otp-f359cffc2590848c9ea4ff366d550c1351569479.tar.bz2 otp-f359cffc2590848c9ea4ff366d550c1351569479.zip |
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rw-r--r-- | erts/emulator/beam/erl_bif_info.c | 13 |
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 52056023fd..903f54e2fb 100644 --- a/erts/emulator/beam/erl_bif_info.c +++ b/erts/emulator/beam/erl_bif_info.c @@ -4334,6 +4334,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); |