[virglrenderer-devel] How to iterate util_hash_table

Zhu Yijun lovemrd at gmail.com
Sun Jun 21 03:15:31 UTC 2020


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.

Yijun


More information about the virglrenderer-devel mailing list