qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Question about the source code.


From: Peter Maydell
Subject: Re: [Qemu-devel] Question about the source code.
Date: Fri, 6 Nov 2015 10:08:31 +0000

On 6 November 2015 at 01:27, Toni Nedialkov <address@hidden> wrote:
> Hello, I have a question pertaining the source code, wondering if I've
> discovered a bug or am just simply confused.
>
> It's about this function in translate-all.c
>
> static void page_flush_tb(void)
> {
>     int i;
>
>     for (i = 0; i < V_L1_SIZE; i++) {
>         page_flush_tb_1(V_L1_SHIFT / V_L2_BITS - 1, l1_map + i);
>     }
> }
>
> Was wondering if l1_map + i is correct, or whether it should be l1_map +
> i*sizeof(i).

If you look at the declaration of l1_map:
    static void *l1_map[V_L1_SIZE];
it is an array of pointers with V_L1_SIZE entries. This
loop is just indexing through that array, and "l1_map + i"
is the same as "&l1_map[i]".

i is just an index here, and the size of the int type
doesn't have any relation to the size of any of the
data structures involved in l1_map.

thanks
-- PMM



reply via email to

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