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/pair1/pair.c | 4 ++-- src/protocol/pair1/pair1_poly.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/protocol/pair1') 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); diff --git a/src/protocol/pair1/pair1_poly.c b/src/protocol/pair1/pair1_poly.c index 183c10da..950c60f7 100644 --- a/src/protocol/pair1/pair1_poly.c +++ b/src/protocol/pair1/pair1_poly.c @@ -280,7 +280,7 @@ pair1poly_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); @@ -361,7 +361,7 @@ pair1poly_pipe_get_cb(void *arg) nni_msg_header_clear(msg); // Insert the hops header. - nni_msg_header_must_append_u32(msg, 1); + nni_msg_header_append_u32(msg, 1); nni_aio_set_msg(&p->aio_send, msg); nni_pipe_send(p->pipe, &p->aio_send); -- cgit v1.2.3-70-g09d2