qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC 06/48] tcg: use QHT for helper_table


From: Emilio G. Cota
Subject: Re: [Qemu-devel] [RFC 06/48] tcg: use QHT for helper_table
Date: Wed, 14 Nov 2018 12:50:53 -0500
User-agent: Mutt/1.9.4 (2018-02-28)

On Wed, Nov 14, 2018 at 14:41:53 +0000, Alex Bennée wrote:
> Emilio G. Cota <address@hidden> writes:
(snip)
> > -static GHashTable *helper_table;
> > +static struct qht helper_table;
> > +static bool helper_table_inited;
> 
> Having a flag for initialisation seems a little excessive considering
> we've moved that initialisation into tcg_context_init() which has to be
> called before we do anything TCG related.

(snip)
> > +    helper_table_inited = true;
> 
> so I think we can drop this and...

(snip)
> > +static inline const char *tcg_helper_find(TCGContext *s, uintptr_t val)
> >  {
> >      const char *ret = NULL;
> > -    if (helper_table) {
> > -        TCGHelperInfo *info = g_hash_table_lookup(helper_table, 
> > (gpointer)val);
> > +    if (helper_table_inited) {
> 
> change this to a assert(helper_table.cmp) if you really want to.

I like this suggestion. The only caller of tcg_helper_find
is tcg_dump_ops, which is unlikely to be called on an
uninitialized TCGContext.

I have added this to v2, without the assert.

(snip)
> Otherwise:
> 
> Reviewed-by: Alex Bennée <address@hidden>

Thanks!

                E.



reply via email to

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