[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 11/22] translate-all: use a binary search tree t
From: |
Emilio G. Cota |
Subject: |
Re: [Qemu-devel] [PATCH 11/22] translate-all: use a binary search tree to track TBs in TBContext |
Date: |
Sun, 9 Jul 2017 17:01:28 -0400 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
On Sun, Jul 09, 2017 at 10:33:41 -1000, Richard Henderson wrote:
> On 07/08/2017 09:50 PM, Emilio G. Cota wrote:
> > #if defined(DEBUG_TB_FLUSH)
> >+ nb_tbs = g_tree_nnodes(tcg_ctx.tb_ctx.tb_tree);
> > printf("qemu: flush code_size=%ld nb_tbs=%d avg_tb_size=%ld\n",
> > (unsigned long)(tcg_ctx.code_gen_ptr - tcg_ctx.code_gen_buffer),
> >- tcg_ctx.tb_ctx.nb_tbs, tcg_ctx.tb_ctx.nb_tbs > 0 ?
> >+ nb_tbs, nb_tbs > 0 ?
> > ((unsigned long)(tcg_ctx.code_gen_ptr -
> > tcg_ctx.code_gen_buffer)) /
> >- tcg_ctx.tb_ctx.nb_tbs : 0);
> >+ nb_tbs : 0);
> > #endif
>
> Variable declaration within braces within the ifdef. Better as size_t or
> unsigned long. Using int to count thing on 64-bit hosts always seems like a
> bug.
g_tree_nnodes returns a gint, which is documented to be a typedef for 'int'.
So I went with that.
But yes, a size_t here is better.
E.
- Re: [Qemu-devel] [PATCH 09/22] exec-all: shrink tb->invalid to uint8_t, (continued)
[Qemu-devel] [PATCH 12/22] translate-all: report correct avg host TB size, Emilio G. Cota, 2017/07/09
[Qemu-devel] [PATCH 16/22] tcg: keep a list of TCGContext's, Emilio G. Cota, 2017/07/09
[Qemu-devel] [PATCH 11/22] translate-all: use a binary search tree to track TBs in TBContext, Emilio G. Cota, 2017/07/09
[Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu, Emilio G. Cota, 2017/07/09
Re: [Qemu-devel] [PATCH 21/22] tcg: enable per-thread TCG for softmmu, Paolo Bonzini, 2017/07/10