Title: [222948] trunk/PerformanceTests
Revision
222948
Author
[email protected]
Date
2017-10-05 18:15:36 -0700 (Thu, 05 Oct 2017)

Log Message

Unreviewed, use std::vector instead of variable length array
https://bugs.webkit.org/show_bug.cgi?id=177856

This is OK because originally this code uses dispatch queue, which
should have allocation inside it too.

* MallocBench/MallocBench/message.cpp:
(benchmark_message_many):

Modified Paths

Diff

Modified: trunk/PerformanceTests/ChangeLog (222947 => 222948)


--- trunk/PerformanceTests/ChangeLog	2017-10-06 00:36:44 UTC (rev 222947)
+++ trunk/PerformanceTests/ChangeLog	2017-10-06 01:15:36 UTC (rev 222948)
@@ -1,5 +1,16 @@
 2017-10-05  Yusuke Suzuki  <[email protected]>
 
+        Unreviewed, use std::vector instead of variable length array
+        https://bugs.webkit.org/show_bug.cgi?id=177856
+
+        This is OK because originally this code uses dispatch queue, which
+        should have allocation inside it too.
+
+        * MallocBench/MallocBench/message.cpp:
+        (benchmark_message_many):
+
+2017-10-05  Yusuke Suzuki  <[email protected]>
+
         [Linux] Port MallocBench
         https://bugs.webkit.org/show_bug.cgi?id=177856
 

Modified: trunk/PerformanceTests/MallocBench/MallocBench/message.cpp (222947 => 222948)


--- trunk/PerformanceTests/MallocBench/MallocBench/message.cpp	2017-10-06 00:36:44 UTC (rev 222947)
+++ trunk/PerformanceTests/MallocBench/MallocBench/message.cpp	2017-10-06 01:15:36 UTC (rev 222948)
@@ -32,6 +32,7 @@
 #include <stdlib.h>
 #include <strings.h>
 #include <thread>
+#include <vector>
 
 #include "mbmalloc.h"
 
@@ -209,9 +210,10 @@
     const size_t quantum = 16;
 
     const size_t queueCount = cpuCount() - 1;
-    std::unique_ptr<WorkQueue> queues[queueCount];
+    std::vector<std::unique_ptr<WorkQueue>> queues;
+    queues.reserve(queueCount);
     for (size_t i = 0; i < queueCount; ++i)
-        queues[i] = std::make_unique<WorkQueue>();
+        queues.emplace_back(std::make_unique<WorkQueue>());
 
     for (size_t i = 0; i < times; i += quantum) {
         for (size_t j = 0; j < quantum; ++j) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to