From: Christopher Dykes Date: Fri, 1 Jul 2016 01:19:14 +0000 (-0700) Subject: Use std::vector in the CacheLocalityBenchmark rather than a VLA X-Git-Tag: 2016.07.26~99 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=61a96501d8da914c23c4d6d0b9ca49a18f58bea0;p=folly.git 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 --- diff --git a/folly/test/CacheLocalityBenchmark.cpp b/folly/test/CacheLocalityBenchmark.cpp index 81f094d9..cc570391 100644 --- a/folly/test/CacheLocalityBenchmark.cpp +++ b/folly/test/CacheLocalityBenchmark.cpp @@ -160,7 +160,7 @@ static void contentionAtWidth(size_t iters, size_t stripes, size_t work) { std::vector threads; while (threads.size() < numThreads) { threads.push_back(std::thread([&, iters, stripes, work]() { - std::atomic* counters[stripes]; + auto counters = std::vector*>(stripes); for (size_t i = 0; i < stripes; ++i) { counters[i] = new (raw.data() + counterAlignment * i) std::atomic();