[Tarantool-patches] [PATCH v2 10/10] xrow: use unaligned store operation in xrow_to_iovec()

Timur Safin tsafin at tarantool.org
Thu May 28 23:20:33 MSK 2020


Indeed! LGTM

: -----Original Message-----
: From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
: Sent: Thursday, May 28, 2020 2:32 AM
: To: tarantool-patches at dev.tarantool.org; alyapunov at tarantool.org;
: korablev at tarantool.org; tsafin at tarantool.org
: Subject: [PATCH v2 10/10] xrow: use unaligned store operation in
: xrow_to_iovec()
: 
: 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)




More information about the Tarantool-patches mailing list