From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsrND-0008LX-Rf for qemu-devel@nongnu.org; Tue, 17 Dec 2013 04:55:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsrN7-00020Z-5g for qemu-devel@nongnu.org; Tue, 17 Dec 2013 04:55:31 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:10207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsrN6-00020K-VX for qemu-devel@nongnu.org; Tue, 17 Dec 2013 04:55:25 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MXY0098B3K84Z90@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 17 Dec 2013 09:55:20 +0000 (GMT) Message-id: <52B01F88.5000908@samsung.com> Date: Tue, 17 Dec 2013 13:55:20 +0400 From: Fedorov Sergey MIME-version: 1.0 References: <1387272004-18531-1-git-send-email-s.fedorov@samsung.com> In-reply-to: Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qom: fix cast results caching List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: "qemu-devel@nongnu.org Developers" , Michael Roth , Paul Brook , Anthony Liguori , Paolo Bonzini , a.basov@samsung.com, =?ISO-8859-1?Q?Andreas_F=E4rber?= On 12/17/2013 01:40 PM, Peter Crosthwaite wrote: > On Tue, Dec 17, 2013 at 7:20 PM, Sergey Fedorov 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 >> --- >> 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 >> >>