ralloc: don't leave out the alignment factor
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 4 Mar 2017 00:49:18 +0000 (02:49 +0200)
committerEric Anholt <eric@anholt.net>
Mon, 6 Mar 2017 19:28:48 +0000 (11:28 -0800)
commitff494fe999510ea40e3ed5827e7818550b6de126
tree08883aec67f6d137d306956b1fae1fee9cdfa998
parentb384c23b9e804916f125354e06c735bd3bb22811
ralloc: don't leave out the alignment factor

Experimentation shows that without alignment factor gcc and clang choose
a factor of 16 even on IA-32, which doesn't match what malloc() uses (8).
The problem is it makes gcc assume the pointer is 16 byte aligned, so
with -O3 it starts using aligned SSE instructions that later fault,
so always specify a suitable alignment factor.

Cc: Jonas Pfeil <pfeiljonas@gmx.de>
Fixes: cd2b55e5 "ralloc: Make sure ralloc() allocations match malloc()'s alignment."
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100049
Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Tested by: Mike Lothian <mike@fireburn.co.uk>
Tested by: Jonas Pfeil <pfeiljonas@gmx.de>
src/util/ralloc.c