Revision: 8279
Author:   [email protected]
Date:     Tue Jun 14 05:48:25 2011
Log:      Make valgrind happy with SparseSet.

[email protected]
BUG=crbug.com/83626

Review URL: http://codereview.chromium.org/7111047
http://code.google.com/p/v8/source/detail?r=8279

Modified:
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Tue Jun 14 02:15:25 2011
+++ /branches/bleeding_edge/src/hydrogen.cc     Tue Jun 14 05:48:25 2011
@@ -1286,7 +1286,12 @@
       : capacity_(capacity),
         length_(0),
         dense_(zone->NewArray<int>(capacity)),
-        sparse_(zone->NewArray<int>(capacity)) {}
+        sparse_(zone->NewArray<int>(capacity)) {
+#ifndef NVALGRIND
+    // Initialize the sparse array to make valgrind happy.
+    memset(sparse_, 0, sizeof(sparse_[0]) * capacity);
+#endif
+  }

   bool Contains(int n) const {
     ASSERT(0 <= n && n < capacity_);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to