Commit 61a96501 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot 8

Use std::vector in the CacheLocalityBenchmark rather than a VLA

Summary: Because MSVC doesn't support VLAs.

Reviewed By: yfeldblum

Differential Revision: D3506835

fbshipit-source-id: 8683b5c513ed25e7f47642c8493f8b10da9906be
parent 48832457
......@@ -160,7 +160,7 @@ static void contentionAtWidth(size_t iters, size_t stripes, size_t work) {
std::vector<std::thread> threads;
while (threads.size() < numThreads) {
threads.push_back(std::thread([&, iters, stripes, work]() {
std::atomic<size_t>* counters[stripes];
auto counters = std::vector<std::atomic<size_t>*>(stripes);
for (size_t i = 0; i < stripes; ++i) {
counters[i] =
new (raw.data() + counterAlignment * i) std::atomic<size_t>();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment