|
From: | Fedorov Sergey |
Subject: | Re: [Qemu-devel] [PATCH] qom: fix cast results caching |
Date: | Tue, 17 Dec 2013 13:55:20 +0400 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 12/17/2013 01:40 PM, Peter Crosthwaite wrote:
On Tue, Dec 17, 2013 at 7:20 PM, Sergey Fedorov <address@hidden> wrote:A single cast cache is used for both an object casting and a class casting. In case of interface presence a class cast result may be not the same pointer as opposite to an object casting. So do not cache cast results for an object casting in a presence of interfaces.I think this is fixed by my cast cache splitter patch which is currently enqueued. http://patchwork.ozlabs.org/patch/294766/ Regards, Peter
Yes, your cache splitter looks much better. Thank you. Best regards, Sergey Fedorov
Signed-off-by: Sergey Fedorov <address@hidden> --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index fc19cf6..f7384de 100644 --- a/qom/object.c +++ b/qom/object.c @@ -473,7 +473,7 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename, assert(obj == inst); - if (obj && obj == inst) { + if (obj && obj == inst && !obj->class->interfaces) { for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) { obj->class->cast_cache[i - 1] = obj->class->cast_cache[i]; } -- 1.7.9.5
[Prev in Thread] | Current Thread | [Next in Thread] |