| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 diff --git a/third_party/re2/util/sparse_array.h b/third_party/re2/util/sparse_a
    rray.h | 
|  | 2 index 3e33f89..613417d 100644 | 
|  | 3 --- a/third_party/re2/util/sparse_array.h | 
|  | 4 +++ b/third_party/re2/util/sparse_array.h | 
|  | 5 @@ -231,7 +231,14 @@ class SparseArray { | 
|  | 6 | 
|  | 7  template<typename Value> | 
|  | 8  SparseArray<Value>::SparseArray() | 
|  | 9 -    : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(), valgrind_(Runni
    ngOnValgrind()) {} | 
|  | 10 +    : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(), | 
|  | 11 +#if defined(MEMORY_SANITIZER) | 
|  | 12 +    valgrind_(true) | 
|  | 13 +#else | 
|  | 14 +    valgrind_(RunningOnValgrind()) | 
|  | 15 +#endif | 
|  | 16 +{ | 
|  | 17 +} | 
|  | 18 | 
|  | 19  // IndexValue pairs: exposed in SparseArray::iterator. | 
|  | 20  template<typename Value> | 
|  | 21 @@ -418,7 +425,11 @@ void SparseArray<Value>::create_index(int i) { | 
|  | 22  template<typename Value> SparseArray<Value>::SparseArray(int max_size) { | 
|  | 23    max_size_ = max_size; | 
|  | 24    sparse_to_dense_ = new int[max_size]; | 
|  | 25 +#if defined(MEMORY_SANITIZER) | 
|  | 26 +  valgrind_ = true; | 
|  | 27 +#else | 
|  | 28    valgrind_ = RunningOnValgrind(); | 
|  | 29 +#endif | 
|  | 30    dense_.resize(max_size); | 
|  | 31    // Don't need to zero the new memory, but appease Valgrind. | 
|  | 32    if (valgrind_) { | 
|  | 33 diff --git a/third_party/re2/util/sparse_set.h b/third_party/re2/util/sparse_set
    .h | 
|  | 34 index 165dd09..f59ed0b 100644 | 
|  | 35 --- a/third_party/re2/util/sparse_set.h | 
|  | 36 +++ b/third_party/re2/util/sparse_set.h | 
|  | 37 @@ -54,13 +54,24 @@ namespace re2 { | 
|  | 38  class SparseSet { | 
|  | 39   public: | 
|  | 40    SparseSet() | 
|  | 41 -    : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(NULL), valgrind_(R
    unningOnValgrind()) {} | 
|  | 42 +    : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(NULL), | 
|  | 43 +#if defined(MEMORY_SANITIZER) | 
|  | 44 +      valgrind_(true) | 
|  | 45 +#else | 
|  | 46 +      valgrind_(RunningOnValgrind()) | 
|  | 47 +#endif | 
|  | 48 +  { | 
|  | 49 +  } | 
|  | 50 | 
|  | 51    SparseSet(int max_size) { | 
|  | 52      max_size_ = max_size; | 
|  | 53      sparse_to_dense_ = new int[max_size]; | 
|  | 54      dense_ = new int[max_size]; | 
|  | 55 +#if defined(MEMORY_SANITIZER) | 
|  | 56 +    valgrind_ = true; | 
|  | 57 +#else | 
|  | 58      valgrind_ = RunningOnValgrind(); | 
|  | 59 +#endif | 
|  | 60      // Don't need to zero the memory, but do so anyway | 
|  | 61      // to appease Valgrind. | 
|  | 62      if (valgrind_) { | 
| OLD | NEW | 
|---|