[Piglit] [v2 PATCH] util: Use posix_memalign for all non-Windows platforms.

Vinson Lee vlee at freedesktop.org
Wed Feb 25 18:54:00 PST 2015


glibc < 2.16 does not have aligned_alloc.

Suggested-by: Jose Fonseca <jfonseca at vmware.com>
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-util.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index b094625..743373a 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -829,14 +829,12 @@ piglit_alloc_aligned(size_t alignment, size_t size)
 {
 #if defined(_WIN32)
 	return _aligned_malloc(size, alignment);
-#elif defined(__APPLE__)
+#else
 	void *p;
 	if (posix_memalign(&p, alignment, size) != 0) {
 		return NULL;
 	}
 	return p;
-#else
-	return aligned_alloc(alignment, size);
 #endif
 }
 
-- 
2.3.0



More information about the Piglit mailing list