aboutsummaryrefslogtreecommitdiff
path: root/gdb/unittests/parallel-for-selftests.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-01 12:31:24 -0700
committerTom Tromey <tom@tromey.com>2024-01-08 18:40:22 -0700
commitafdd1366358c477f986ca1af9f3cdc869ce15156 (patch)
treee27838b547afef10822580224ac1f0731cc74d7f /gdb/unittests/parallel-for-selftests.c
parent667ed4b14ddaa9af196481f1757c0e517e80b6ed (diff)
downloadgdb-afdd1366358c477f986ca1af9f3cdc869ce15156.zip
gdb-afdd1366358c477f986ca1af9f3cdc869ce15156.tar.gz
gdb-afdd1366358c477f986ca1af9f3cdc869ce15156.tar.bz2
Back out some parallel_for_each features
Now that the DWARF reader does not use parallel_for_each, we can remove some of the features that were added just for it: return values and task sizing. The thread_pool typed tasks feature could also be removed, but I haven't done so here. This one seemed less intrusive and perhaps more likely to be needed at some point.
Diffstat (limited to 'gdb/unittests/parallel-for-selftests.c')
-rw-r--r--gdb/unittests/parallel-for-selftests.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/gdb/unittests/parallel-for-selftests.c b/gdb/unittests/parallel-for-selftests.c
index 63e9512..a957b2d 100644
--- a/gdb/unittests/parallel-for-selftests.c
+++ b/gdb/unittests/parallel-for-selftests.c
@@ -120,34 +120,6 @@ TEST (int n_threads)
});
SELF_CHECK (counter == 0);
- auto task_size_max_ = [] (int iter)
- {
- return (size_t)SIZE_MAX;
- };
- auto task_size_max = gdb::make_function_view (task_size_max_);
-
- counter = 0;
- FOR_EACH (1, 0, NUMBER,
- [&] (int start, int end)
- {
- counter += end - start;
- }, task_size_max);
- SELF_CHECK (counter == NUMBER);
-
- auto task_size_one_ = [] (int iter)
- {
- return (size_t)1;
- };
- auto task_size_one = gdb::make_function_view (task_size_one_);
-
- counter = 0;
- FOR_EACH (1, 0, NUMBER,
- [&] (int start, int end)
- {
- counter += end - start;
- }, task_size_one);
- SELF_CHECK (counter == NUMBER);
-
#undef NUMBER
/* Check that if there are fewer tasks than threads, then we won't
@@ -169,25 +141,6 @@ TEST (int n_threads)
{
return entry != nullptr;
}));
-
- /* The same but using the task size parameter. */
- intresults.clear ();
- any_empty_tasks = false;
- FOR_EACH (1, 0, 1,
- [&] (int start, int end)
- {
- if (start == end)
- any_empty_tasks = true;
- return std::make_unique<int> (end - start);
- },
- task_size_one);
- SELF_CHECK (!any_empty_tasks);
- SELF_CHECK (std::all_of (intresults.begin (),
- intresults.end (),
- [] (const std::unique_ptr<int> &entry)
- {
- return entry != nullptr;
- }));
}
#endif /* FOR_EACH */