qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 08/10] tcg: Save flags and computed sizemask in


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 08/10] tcg: Save flags and computed sizemask in TCGHelperInfo
Date: Tue, 13 May 2014 06:54:59 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/13/2014 02:38 AM, Alex Bennée wrote:
>> +    info = g_hash_table_lookup(s->helpers, (gpointer)func);
>> > +    assert(info != NULL);
>> > +    assert(info->sizemask == sizemask);
> I assume g_assert vs assert is purely cosmetic? QEMU seems inconsistent
> at best about this :-/

Yes indeed.  It doesn't help that g_assert is stupid and doesn't evaluate its
argument when assertions are disabled, so that you can get unused variable
warnings.

The best sort of assert is as we do for tcg_debug_assert, where we invoke
__builtin_unreachable when not aborting, which gives the compiler optimization
info about the expression.

I'm not sure how best to clean all this up in qemu, but I'm pretty sure that
more use of glib isn't it.


r~



reply via email to

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