diff options
author | Sverker Eriksson <[email protected]> | 2018-01-04 19:04:09 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-01-05 14:40:04 +0100 |
commit | f0123ff032ea2f9b4aa30322ad476e3f79757e79 (patch) | |
tree | 3133565d4c5530d546008a49fa8b62c35d8122e2 /erts/emulator/beam/erl_io_queue.c | |
parent | f496717590d610bd08f02bec39f8e97886c68729 (diff) | |
download | otp-f0123ff032ea2f9b4aa30322ad476e3f79757e79.tar.gz otp-f0123ff032ea2f9b4aa30322ad476e3f79757e79.tar.bz2 otp-f0123ff032ea2f9b4aa30322ad476e3f79757e79.zip |
erts: Refactor more usage of erts_build_proc_bin
Diffstat (limited to 'erts/emulator/beam/erl_io_queue.c')
-rw-r--r-- | erts/emulator/beam/erl_io_queue.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/erts/emulator/beam/erl_io_queue.c b/erts/emulator/beam/erl_io_queue.c index 190ba6bbb9..f678889f81 100644 --- a/erts/emulator/beam/erl_io_queue.c +++ b/erts/emulator/beam/erl_io_queue.c @@ -817,24 +817,15 @@ static Eterm iol2v_make_sub_bin(iol2v_state_t *state, Eterm bin_term, } static Eterm iol2v_promote_acc(iol2v_state_t *state) { - ProcBin *pb; - - state->acc = erts_bin_realloc(state->acc, state->acc_size); - - pb = (ProcBin*)HAlloc(state->process, PROC_BIN_SIZE); - pb->thing_word = HEADER_PROC_BIN; - pb->size = state->acc_size; - pb->val = state->acc; - pb->bytes = (byte*)(state->acc)->orig_bytes; - pb->flags = 0; - pb->next = MSO(state->process).first; - OH_OVERHEAD(&(MSO(state->process)), pb->size / sizeof(Eterm)); - MSO(state->process).first = (struct erl_off_heap_header*)pb; + Eterm bin; + bin = erts_build_proc_bin(&MSO(state->process), + HAlloc(state->process, PROC_BIN_SIZE), + erts_bin_realloc(state->acc, state->acc_size)); state->acc_size = 0; state->acc = NULL; - return make_binary(pb); + return bin; } /* Destructively enqueues a term to the result list, saving us the hassle of |