Commit d254298e authored by vitalyr@chromium.org's avatar vitalyr@chromium.org

Make valgrind happy with SparseSet.

R=ager@chromium.org
BUG=crbug.com/83626

Review URL: http://codereview.chromium.org/7111047

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8279 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7d527f85
...@@ -1286,7 +1286,12 @@ class SparseSet { ...@@ -1286,7 +1286,12 @@ class SparseSet {
: capacity_(capacity), : capacity_(capacity),
length_(0), length_(0),
dense_(zone->NewArray<int>(capacity)), 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 { bool Contains(int n) const {
ASSERT(0 <= n && n < capacity_); ASSERT(0 <= n && n < capacity_);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment