From 449cb6b37b54bd6e4a7058e97739d9634ccefaa7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 14 Aug 2008 10:10:53 +0100 Subject: [PATCH] mesa: posix_memalign requires alignment to be multiple of sizeof(void*) --- src/gallium/include/pipe/p_util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/include/pipe/p_util.h b/src/gallium/include/pipe/p_util.h index 4e1a996122d..b4ab70a3fc8 100644 --- a/src/gallium/include/pipe/p_util.h +++ b/src/gallium/include/pipe/p_util.h @@ -213,6 +213,7 @@ align_malloc(size_t bytes, uint alignment) { #if defined(HAVE_POSIX_MEMALIGN) void *mem; + alignment = (alignment + (uint)sizeof(void*) - 1) & ~((uint)sizeof(void*) - 1); if(posix_memalign(& mem, alignment, bytes) != 0) return NULL; return mem; -- 2.30.2