From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 3F9734696C0 for ; Thu, 28 May 2020 02:32:33 +0300 (MSK) From: Vladislav Shpilevoy Date: Thu, 28 May 2020 01:32:20 +0200 Message-Id: <5921ba4ecb59842c6999eff24ef5f832ac853765.1590622225.git.v.shpilevoy@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v2 10/10] xrow: use unaligned store operation in xrow_to_iovec() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, alyapunov@tarantool.org, korablev@tarantool.org, tsafin@tarantool.org xrow_to_iovec() tried to save a uint32_t value by a not aligned address. The patch makes it use a special operation for that instead of regular assignment. Part of #4609 --- src/box/xrow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/xrow.c b/src/box/xrow.c index 06473a8bc..bb64864b2 100644 --- a/src/box/xrow.c +++ b/src/box/xrow.c @@ -892,7 +892,7 @@ xrow_to_iovec(const struct xrow_header *row, struct iovec *out) /* Encode length */ char *data = (char *) out[0].iov_base; *(data++) = 0xce; /* MP_UINT32 */ - *(uint32_t *) data = mp_bswap_u32(len); + store_u32(data, mp_bswap_u32(len)); assert(iovcnt <= XROW_IOVMAX); return iovcnt; -- 2.21.1 (Apple Git-122.3)