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

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

Issue 1516543002: Update re2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 5 years 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
OLDNEW
(Empty)
1 diff --git a/third_party/re2/util/sparse_array.h b/third_party/re2/util/sparse_a rray.h
battre 2015/12/10 13:32:05 I think this is not needed anymore. RunningOnVali
2 index 3e33f89..4ee5c94 100644
3 --- a/third_party/re2/util/sparse_array.h
4 +++ b/third_party/re2/util/sparse_array.h
5 @@ -231,7 +231,8 @@ 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 + valgrind_(RunningOnValgrindOrMemorySanitizer()) {}
12
13 // IndexValue pairs: exposed in SparseArray::iterator.
14 template<typename Value>
15 @@ -418,7 +419,7 @@ void SparseArray<Value>::create_index(int i) {
16 template<typename Value> SparseArray<Value>::SparseArray(int max_size) {
17 max_size_ = max_size;
18 sparse_to_dense_ = new int[max_size];
19 - valgrind_ = RunningOnValgrind();
20 + valgrind_ = RunningOnValgrindOrMemorySanitizer();
21 dense_.resize(max_size);
22 // Don't need to zero the new memory, but appease Valgrind.
23 if (valgrind_) {
24 diff --git a/third_party/re2/util/sparse_set.h b/third_party/re2/util/sparse_set .h
25 index 165dd09..4a324d7 100644
26 --- a/third_party/re2/util/sparse_set.h
27 +++ b/third_party/re2/util/sparse_set.h
28 @@ -54,13 +54,14 @@ namespace re2 {
29 class SparseSet {
30 public:
31 SparseSet()
32 - : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(NULL), valgrind_(R unningOnValgrind()) {}
33 + : size_(0), max_size_(0), sparse_to_dense_(NULL), dense_(NULL),
34 + valgrind_(RunningOnValgrindOrMemorySanitizer()) {}
35
36 SparseSet(int max_size) {
37 max_size_ = max_size;
38 sparse_to_dense_ = new int[max_size];
39 dense_ = new int[max_size];
40 - valgrind_ = RunningOnValgrind();
41 + valgrind_ = RunningOnValgrindOrMemorySanitizer();
42 // Don't need to zero the memory, but do so anyway
43 // to appease Valgrind.
44 if (valgrind_) {
45 diff --git a/third_party/re2/util/util.h b/third_party/re2/util/util.h
46 index de1ef5b..49159c2 100644
47 --- a/third_party/re2/util/util.h
48 +++ b/third_party/re2/util/util.h
49 @@ -129,6 +129,14 @@ static inline uint64 Hash64StringWithSeed(const char* s, in t len, uint32 seed) {
50 return ((uint64)x << 32) | y;
51 }
52
53 +inline bool RunningOnValgrindOrMemorySanitizer() {
54 +#if defined(MEMORY_SANITIZER)
55 + return true;
56 +#else
57 + return RunningOnValgrind();
58 +#endif
59 +}
60 +
61 } // namespace re2
62
63 #include "util/arena.h"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698