qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 for-2.5 05/12] tcg/optimize: track const/copy


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 for-2.5 05/12] tcg/optimize: track const/copy status separately
Date: Mon, 27 Jul 2015 13:26:26 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1


On 27/07/2015 12:56, Aurelien Jarno wrote:
>          temps[dst].next_copy = temps[src].next_copy;
>          temps[dst].prev_copy = src;
>          temps[temps[dst].next_copy].prev_copy = dst;
>          temps[src].next_copy = dst;

This is:

    dst->next = src->next;
    dst->prev = src;
    dst->next->prev = dst;
    src->next = dst;

which seems weird.  I think it should be one of

    /* splice src after dst */
    dst->next->prev = src->prev;
    src->prev->next = dst->next;
    dst->next = src;
    src->prev = dst;

or

    /* splice src before dst */
    last = src->prev;
    dst->prev->next = src;
    src->prev = dst->prev;
    last->next = dst;
    dst->prev = last;

(written as pointer manipulations for clarity).

Maybe I'm missing the obvious, but if it's a problem it's better to fix
it before the links are used more pervasively.

Paolo



reply via email to

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