aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-08-14 10:10:53 +0100
committerJosé Fonseca <[email protected]>2008-08-14 11:01:42 +0100
commit449cb6b37b54bd6e4a7058e97739d9634ccefaa7 (patch)
tree3b0d100e4fdabe8645dad0e80c76fdbedcfc1264 /src/gallium
parenta8540ef9fb22bbedc788c374fda3354047df110f (diff)
mesa: posix_memalign requires alignment to be multiple of sizeof(void*)
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/include/pipe/p_util.h1
1 files changed, 1 insertions, 0 deletions
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;