aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_io_queue.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-01-16 15:02:26 +0100
committerSverker Eriksson <[email protected]>2018-01-16 15:02:26 +0100
commitb02208125f27b20e6ce186afcdc6b79e24ac732a (patch)
treed882dcccfee7cdd7faf0a4172758d2303732ec16 /erts/emulator/beam/erl_io_queue.c
parent0841f405cdce1392a4d8975618c4e0895eb8a6b7 (diff)
parentf0123ff032ea2f9b4aa30322ad476e3f79757e79 (diff)
downloadotp-b02208125f27b20e6ce186afcdc6b79e24ac732a.tar.gz
otp-b02208125f27b20e6ce186afcdc6b79e24ac732a.tar.bz2
otp-b02208125f27b20e6ce186afcdc6b79e24ac732a.zip
Merge branch 'sverker/build-proc-bin'
Diffstat (limited to 'erts/emulator/beam/erl_io_queue.c')
-rw-r--r--erts/emulator/beam/erl_io_queue.c19
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 40d69ea6b0..c93b5248d9 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