[virglrenderer-devel] How to iterate util_hash_table

Chia-I Wu olvaffe at gmail.com
Thu Jun 25 04:59:08 UTC 2020


On Sun, Jun 21, 2020 at 10:57 PM Zhu Yijun <lovemrd at gmail.com> wrote:
>
> Hi all,
>   I want to walk through each item in util_hash_table in order to
> support migration, such as sub_ctx's object table. Currently, my way
> is to maintain an extra object_handle_list member in
> vrend_sub_context, and then get all items by vrend_object_lookup, as
> below:
>
>   struct vrend_object_handle *obj;
>   LIST_FOR_EACH_ENTRY(obj, &sub->object_handle_list, head) {
> state = vrend_object_lookup(sub->object_hash, obj->handle, VIRGL_OBJECT_DSA);
>   }
>
>   It looks ugly, is there a simple method to iterate util_hash_table? Thanks.
util_hash_table_foreach?

>
> Yijun
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel


More information about the virglrenderer-devel mailing list