From abab1392c11395d387e3072c4f5788d284846093 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Wed, 26 Feb 2020 00:22:11 -0800 Subject: 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. --- src/protocol/reqrep0/req.c | 2 +- src/protocol/reqrep0/xrep.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/protocol/reqrep0') diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c index fea95725..cb716941 100644 --- a/src/protocol/reqrep0/req.c +++ b/src/protocol/reqrep0/req.c @@ -667,7 +667,7 @@ req0_ctx_send(void *arg, nni_aio *aio) } ctx->request_id = (uint32_t) id; nni_msg_header_clear(msg); - nni_msg_header_must_append_u32(msg, ctx->request_id); + nni_msg_header_append_u32(msg, ctx->request_id); // If no pipes are ready, and the request was a poll (no background // schedule), then fail it. Should be NNG_ETIMEDOUT. diff --git a/src/protocol/reqrep0/xrep.c b/src/protocol/reqrep0/xrep.c index 901cecc4..0bce27ba 100644 --- a/src/protocol/reqrep0/xrep.c +++ b/src/protocol/reqrep0/xrep.c @@ -290,7 +290,7 @@ xrep0_pipe_recv_cb(void *arg) nni_msg_set_pipe(msg, nni_pipe_id(p->pipe)); // Store the pipe id in the header, first thing. - nni_msg_header_must_append_u32(msg, nni_pipe_id(p->pipe)); + nni_msg_header_append_u32(msg, nni_pipe_id(p->pipe)); // Move backtrace from body to header hops = 1; -- cgit v1.2.3-70-g09d2