]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/symtab] Use task size in parallel for in process_queue users/vries/process-queue-parallel
authorTom de Vries <tdevries@suse.de>
Tue, 19 Jul 2022 15:01:21 +0000 (17:01 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 21 Jul 2022 13:06:40 +0000 (15:06 +0200)
gdb/dwarf2/read.c

index c0d65218172543341b8541b9e31fad310697ecb4..b279db3ac8bc2d642cd20e5b87cf98f84b398177 100644 (file)
@@ -7624,6 +7624,14 @@ process_queue (dwarf2_per_objfile *per_objfile)
   using iter_type = decltype (per_objfile->queue->begin ());
   using result_type = int;
 
+    std::function<unsigned int (iter_type)> task_size
+      = [=] (iter_type iter)
+      {
+       dwarf2_queue_item &item = *iter;
+       dwarf2_per_cu_data *per_cu = item.per_cu;
+       return per_cu->length ();
+      };
+
   /* The queue starts out with one item, but following a DIE reference
      may load a new CU, adding it to the end of the queue.  */
   while (!per_objfile->queue->empty ())
@@ -7642,7 +7650,7 @@ process_queue (dwarf2_per_objfile *per_objfile)
            }
 
          return result_type (1);
-       });
+       }, &task_size);
 
       for (int i = 0; i < nr_to_be_processed; ++i)
        {