|
From: | Richard Henderson |
Subject: | Re: [Qemu-devel] [RFC 3/7] translate-all: use a binary search tree to track TBs in TBContext |
Date: | Fri, 30 Jun 2017 00:41:35 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 06/29/2017 01:28 PM, Emilio G. Cota wrote:
+/* @key is already in the tree so it's safe to use container_of on it */ +static gint tc_ptr_cmp(gconstpointer candidate, gconstpointer key) +{ + uintptr_t a = *(uintptr_t *)candidate; + const TranslationBlock *tb = container_of(key, TranslationBlock, tc_ptr);
This I'm not keen on. It'd be one thing if it was our own datastructure, but I see nothing in the GTree documentation that says that the comparison must always be done this way.
r~
[Prev in Thread] | Current Thread | [Next in Thread] |