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

Side by Side Diff: third_party/re2/patches/re2-msan.patch

Issue 149723005: Patch re2 to support MSan. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_) {
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698