[Tarantool-patches] [PATCH v2 small 1/1] lsregion: introduce aligned alloc

Aleksandr Lyapunov alyapunov at tarantool.org
Tue May 19 19:16:30 MSK 2020


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.


More information about the Tarantool-patches mailing list