From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp34.i.mail.ru (smtp34.i.mail.ru [94.100.177.94]) (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 E6CB0469710 for ; Fri, 15 May 2020 02:31:06 +0300 (MSK) From: Vladislav Shpilevoy Date: Fri, 15 May 2020 01:31:02 +0200 Message-Id: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH small 0/2] Aligned lsregion List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, korablev@tarantool.org, tsafin@tarantool.org, gorcunov@gmail.com The patchset introduces a new function - lsregion_aligned_alloc(). This activity goes in scope of the big issue about lots of 'undefined behaviour' cases among Tarantool sources. One and the biggest of which is unaligned memory access. Currently lsregion is used in vinyl for statements and BPS tree blocks. All of them are not aligned. Addresses are absolutely arbitrary, sometimes even odd, like ending with 1, 9, etc. Not counting UB, this is also slower, may be much slower sometimes. Branch: http://github.com/tarantool/small/tree/gerold103/aligned-lsregion Issue: https://github.com/tarantool/tarantool/issues/4609 Vladislav Shpilevoy (2): lsregion: introduce lsregion_reserve() lsregion: provide aligned version of alloc small/lsregion.c | 12 ++----- small/lsregion.h | 78 +++++++++++++++++++++++++++++++++--------- test/lsregion.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 152 insertions(+), 26 deletions(-) -- 2.21.1 (Apple Git-122.3)