Closed sholsapp closed 8 years ago
Under some conditions when actually interposing the allocator, we blow up at random spots, so adding bug tag.
Confirmed using a test case like the following that this is an issue for the main application heap.
282 TEST_F(MallocTests, ParallelCheck) {
283 std::vector<std::thread> threads;
284 for (int i = 0; i < 2; i++) {
285 threads.push_back(std::thread(parallel_test_work));
286 }
287 for (auto &thread : threads) {
288 fprintf(stderr, "Joining\n");
289 thread.detach();
290 }
291 }
Where parallel_test_work
just does some random allocation/free work.
An example of a parallel test exists in test_malloc.cpp
in ParallelTest
. Use this as a template.
Add tests that use the various allocators in parallel.