Tarantool development patches archive
 help / color / mirror / Atom feed
From: Aleksandr Lyapunov <alyapunov@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org, tsafin@tarantool.org,
	gorcunov@gmail.com
Subject: Re: [Tarantool-patches] [PATCH v2 small 1/1] lsregion: introduce aligned alloc
Date: Tue, 19 May 2020 19:16:30 +0300	[thread overview]
Message-ID: <37627072-9069-6c17-8546-46793dd4d2c1@tarantool.org> (raw)
In-Reply-To: <194d73cbb844795fbe2a9a6599bb684f4e6a0cf2.1589584903.git.v.shpilevoy@tarantool.org>

Thank for the changes! lgtm.

On 5/16/20 2:21 AM, Vladislav Shpilevoy wrote:
> lsregion_alloc() can return a not aligned address, even odd. This
> is not good when the allocation is going to be used for a type,
> which requires alignment, such as a number, or a struct having
> numbers in it.
>
> Unaligned access to objects saved into the returned memory is
> either slower than aligned access, or can even lead to a crash on
> certain architectures. Also it makes 'alignment' clang sanitizer
> crazy.
>
> The patch provides a function to make aligned allocations on
> lsregion.
>
> Part of https://github.com/tarantool/tarantool/issues/4609
> ---
> Branch: http://github.com/tarantool/small/tree/gerold103/aligned-lsregion
> Issue: https://github.com/tarantool/tarantool/issues/4609
>
> Changes in v2:
> - Made lsregion do not reserve extra bytes, when aligned
>    allocation is requested, and the first available address is
>    already aligned.

  reply	other threads:[~2020-05-19 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 23:21 Vladislav Shpilevoy
2020-05-19 16:16 ` Aleksandr Lyapunov [this message]
2020-05-19 16:21 ` Timur Safin
2020-05-19 21:29   ` Vladislav Shpilevoy
2020-05-19 21:48     ` Timur Safin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37627072-9069-6c17-8546-46793dd4d2c1@tarantool.org \
    --to=alyapunov@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=tsafin@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 small 1/1] lsregion: introduce aligned alloc' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox