aboutsummaryrefslogtreecommitdiff
path: root/src/protocol/pair1/pair.c
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2020-02-26 00:22:11 -0800
committerGarrett D'Amore <garrett@damore.org>2020-02-26 20:48:22 -0800
commitabab1392c11395d387e3072c4f5788d284846093 (patch)
treedbb1ecb2b166338496981c7d8e3e9e16b977b995 /src/protocol/pair1/pair.c
parent6a59b15fba1085432c4c18952680e14d80dd134a (diff)
downloadnng-abab1392c11395d387e3072c4f5788d284846093.tar.gz
nng-abab1392c11395d387e3072c4f5788d284846093.tar.bz2
nng-abab1392c11395d387e3072c4f5788d284846093.zip
fixes #1171 message header could be inlined in the message structure
This uses a maximum 64-byte header and should avoid allocations and cache misses, leading to a small performance boost overall.
Diffstat (limited to 'src/protocol/pair1/pair.c')
-rw-r--r--src/protocol/pair1/pair.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocol/pair1/pair.c b/src/protocol/pair1/pair.c
index b98975c3..00959a4c 100644
--- a/src/protocol/pair1/pair.c
+++ b/src/protocol/pair1/pair.c
@@ -281,7 +281,7 @@ pair1_pipe_recv_cb(void *arg)
}
// Store the hop count in the header.
- nni_msg_header_must_append_u32(msg, hdr);
+ nni_msg_header_append_u32(msg, hdr);
// Send the message up.
nni_aio_set_msg(&p->aio_put, msg);
@@ -345,7 +345,7 @@ pair1_pipe_get_cb(void *arg)
hops++;
// Insert the hops header.
- nni_msg_header_must_append_u32(msg, hops);
+ nni_msg_header_append_u32(msg, hops);
nni_aio_set_msg(&p->aio_send, msg);
nni_pipe_send(p->pipe, &p->aio_send);