diff options
author | Lukas Larsson <[email protected]> | 2018-09-18 15:27:01 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2019-02-21 16:38:04 +0100 |
commit | 0184c2e0438ac42c44d14e92b13e2807e0a670b3 (patch) | |
tree | ed3189b7efad20435fd8443279e75e623af36b52 /erts/emulator/beam/io.c | |
parent | 45c57256d06b14bae7a4f19978a375e360b609cf (diff) | |
download | otp-0184c2e0438ac42c44d14e92b13e2807e0a670b3.tar.gz otp-0184c2e0438ac42c44d14e92b13e2807e0a670b3.tar.bz2 otp-0184c2e0438ac42c44d14e92b13e2807e0a670b3.zip |
erts: Remove a copy of distribution data payload
Before this change the inet driver was in list mode and
thus the data from it had to be copied when received by
the dist entry. This change puts the tcp port in binary mode
and makes the any refc binary created by it be used all the way
to the process where it is decoded.
Thus eliminating one copy of the entire message payload.
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r-- | erts/emulator/beam/io.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index 6a2be52e11..36824fe62c 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -6181,6 +6181,7 @@ int driver_output_binary(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, dep, conn_id, (byte*) hbuf, hlen, + ErlDrvBinary2Binary(bin), (byte*) (bin->orig_bytes+offs), len); } else @@ -6226,12 +6227,14 @@ int driver_output2(ErlDrvPort ix, char* hbuf, ErlDrvSizeT hlen, dep, conn_id, NULL, 0, + NULL, (byte*) hbuf, hlen); else return erts_net_message(prt, dep, conn_id, (byte*) hbuf, hlen, + NULL, (byte*) buf, len); } else if (state & ERTS_PORT_SFLG_LINEBUF_IO) |