From ad3e00c22001cbd3a313a9c577bcacad8cf805b0 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Fri, 7 Aug 2015 17:21:08 +0000 Subject: [PATCH] Stop using a variable-sized array since that's not standards-compliant --- test/cpp/qps/client.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h index 23993131ccf..a6bd1e43431 100644 --- a/test/cpp/qps/client.h +++ b/test/cpp/qps/client.h @@ -83,7 +83,8 @@ class Client { ClientStats Mark() { Histogram latencies; - Histogram to_merge[threads_.size()]; // avoid std::vector for old compilers + // avoid std::vector for old compilers + Histogram *to_merge = new Histogram[threads_.size()]; for (size_t i = 0; i < threads_.size(); i++) { threads_[i]->BeginSwap(&to_merge[i]); } @@ -93,6 +94,7 @@ class Client { threads_[i]->EndSwap(); latencies.Merge(&to_merge[i]); } + delete[] to_merge; auto timer_result = timer->Mark();