Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: third_party/re2/util/sparse_array.h

Issue 149723005: Patch re2 to support MSan. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/patches/re2-msan.patch ('k') | third_party/re2/util/sparse_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/util/sparse_array.h
diff --git a/third_party/re2/util/sparse_array.h b/third_party/re2/util/sparse_array.h
index 3e33f8999315d0c0e0fd3138ee70bafea2eed227..613417d6ced7e4692b14e940d49bf19ac79bf732 100644
--- a/third_party/re2/util/sparse_array.h
+++ b/third_party/re2/util/sparse_array.h
@@ -231,7 +231,14 @@ class SparseArray {
template<typename Value>
SparseArray<Value>::SparseArray()
- : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(), valgrind_(RunningOnValgrind()) {}
+ : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(),
+#if defined(MEMORY_SANITIZER)
eugenis 2014/01/30 09:02:55 I think it would be cleaner to implement RunningOn
+ valgrind_(true)
+#else
+ valgrind_(RunningOnValgrind())
+#endif
+{
+}
// IndexValue pairs: exposed in SparseArray::iterator.
template<typename Value>
@@ -418,7 +425,11 @@ void SparseArray<Value>::create_index(int i) {
template<typename Value> SparseArray<Value>::SparseArray(int max_size) {
max_size_ = max_size;
sparse_to_dense_ = new int[max_size];
+#if defined(MEMORY_SANITIZER)
+ valgrind_ = true;
+#else
valgrind_ = RunningOnValgrind();
+#endif
dense_.resize(max_size);
// Don't need to zero the new memory, but appease Valgrind.
if (valgrind_) {
« no previous file with comments | « third_party/re2/patches/re2-msan.patch ('k') | third_party/re2/util/sparse_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698