qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 2/2] util/oslib: Assert qemu_try_memalign() alignment is a


From: Richard Henderson
Subject: Re: [PATCH v4 2/2] util/oslib: Assert qemu_try_memalign() alignment is a power of 2
Date: Wed, 21 Oct 2020 09:01:05 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 10/20/20 4:17 AM, Philippe Mathieu-Daudé wrote:
> @@ -200,6 +200,9 @@ void *qemu_try_memalign(size_t alignment, size_t size)
>  
>      if (alignment < sizeof(void*)) {
>          alignment = sizeof(void*);
> +    } else {
> +        g_assert(QEMU_IS_ALIGNED(alignment, sizeof(void *)));

This is redundant with the if above, and the assert below.

> +        g_assert(is_power_of_2(alignment));


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]