From: José Fonseca Date: Thu, 14 Aug 2008 09:10:53 +0000 (+0100) Subject: mesa: posix_memalign requires alignment to be multiple of sizeof(void*) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=449cb6b37b54bd6e4a7058e97739d9634ccefaa7;p=mesa.git mesa: posix_memalign requires alignment to be multiple of sizeof(void*) --- 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;