Skip to content
Snippets Groups Projects
Commit ad3e00c2 authored by Vijay Pai's avatar Vijay Pai
Browse files

Stop using a variable-sized array since that's not standards-compliant

parent 90e73694
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,8 @@ class Client { ...@@ -83,7 +83,8 @@ class Client {
ClientStats Mark() { ClientStats Mark() {
Histogram latencies; 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++) { for (size_t i = 0; i < threads_.size(); i++) {
threads_[i]->BeginSwap(&to_merge[i]); threads_[i]->BeginSwap(&to_merge[i]);
} }
...@@ -93,6 +94,7 @@ class Client { ...@@ -93,6 +94,7 @@ class Client {
threads_[i]->EndSwap(); threads_[i]->EndSwap();
latencies.Merge(&to_merge[i]); latencies.Merge(&to_merge[i]);
} }
delete[] to_merge;
auto timer_result = timer->Mark(); auto timer_result = timer->Mark();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment