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

Jose Fonseca jfonseca at vmware.com
Thu Feb 26 01:44:54 PST 2015


On 26/02/15 02:54, Vinson Lee wrote:
> 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
>   }
>
>

Looks great. Thanks for the update Vinson.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>


More information about the Piglit mailing list