msymbols = m_objfile->per_bfd->msymbols.get ();
/* Arbitrarily require at least 10 elements in a thread. */
- gdb::parallel_for_each (10, &msymbols[0], &msymbols[mcount],
+ gdb::parallel_for_each<10> (&msymbols[0], &msymbols[mcount],
[&] (minimal_symbol *start, minimal_symbol *end)
{
scoped_time_it time_it ("minsyms install worker");
const std::vector<do_foreach_t> for_each_functions
{
[] (int start, int end, foreach_callback_t callback)
- { gdb::parallel_for_each (1, start, end, callback); },
+ { gdb::parallel_for_each<1> (start, end, callback); },
[] (int start, int end, foreach_callback_t callback)
- { gdb::sequential_for_each (1, start, end, callback);}
+ { gdb::sequential_for_each (start, end, callback);}
};
for (int n_threads : { 0, 1, 3 })
at least N elements processed per thread. Setting N to 0 is not
allowed. */
-template<class RandomIt, class RangeFunction>
+template<std::size_t n, class RandomIt, class RangeFunction>
void
-parallel_for_each (unsigned n, RandomIt first, RandomIt last,
- RangeFunction callback)
+parallel_for_each (RandomIt first, RandomIt last, RangeFunction callback)
{
/* If enabled, print debug info about how the work is distributed across
the threads. */
if (parallel_for_each_debug)
{
debug_printf (_("Parallel for: n_elements: %zu\n"), n_elements);
- debug_printf (_("Parallel for: minimum elements per thread: %u\n"), n);
+ debug_printf (_("Parallel for: minimum elements per thread: %zu\n"), n);
debug_printf (_("Parallel for: elts_per_thread: %zu\n"), elts_per_thread);
}
template<class RandomIt, class RangeFunction>
void
-sequential_for_each (unsigned n, RandomIt first, RandomIt last,
- RangeFunction callback)
+sequential_for_each (RandomIt first, RandomIt last, RangeFunction callback)
{
callback (first, last);
}