util/ralloc: fix ralloc alignment.
authorLepton Wu <lepton@chromium.org>
Fri, 14 Aug 2020 02:14:13 +0000 (19:14 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 21 Aug 2020 18:22:21 +0000 (18:22 +0000)
commita4c708dd24e5ba8ac381973c14db8d23f4ac97bf
tree065eaa7d039d21a6d516bf12aadac528400ca34a
parentfd7e1ed86d856cc4bb12bf550ef43e1cb81d0c0c
util/ralloc: fix ralloc alignment.

On some malloc implementation, malloc doesn't always align to 16
bytes even on 64 bits system. To make sure ralloc_header always
starts at the wanted alignment, just force the size to be aligned at
the alignment of ralloc_header. This fixes crashed on instruction
like "movaps %xmm0,0x10(%rax)" which requires aligned memory access.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6314>
src/util/ralloc.c