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

Side by Side Diff: third_party/re2/util/util.h

Issue 149723005: Patch re2 to support MSan. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address eugenis's suggestions 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
« no previous file with comments | « third_party/re2/util/sparse_set.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The RE2 Authors. All Rights Reserved. 1 // Copyright 2009 The RE2 Authors. All Rights Reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 #ifndef RE2_UTIL_UTIL_H__ 5 #ifndef RE2_UTIL_UTIL_H__
6 #define RE2_UTIL_UTIL_H__ 6 #define RE2_UTIL_UTIL_H__
7 7
8 // C 8 // C
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 123
124 static inline uint64 Hash64StringWithSeed(const char* s, int len, uint32 seed) { 124 static inline uint64 Hash64StringWithSeed(const char* s, int len, uint32 seed) {
125 uint32 x, y; 125 uint32 x, y;
126 x = seed; 126 x = seed;
127 y = 0; 127 y = 0;
128 hashword2((uint32*)s, len/4, &x, &y); 128 hashword2((uint32*)s, len/4, &x, &y);
129 return ((uint64)x << 32) | y; 129 return ((uint64)x << 32) | y;
130 } 130 }
131 131
132 inline bool RunningOnValgrindOrMemorySanitizer() {
133 #if defined(MEMORY_SANITIZER)
134 return true;
135 #else
136 return RunningOnValgrind();
137 #endif
138 }
139
132 } // namespace re2 140 } // namespace re2
133 141
134 #include "util/arena.h" 142 #include "util/arena.h"
135 #include "util/logging.h" 143 #include "util/logging.h"
136 #include "util/mutex.h" 144 #include "util/mutex.h"
137 #include "util/utf.h" 145 #include "util/utf.h"
138 146
139 #endif // RE2_UTIL_UTIL_H__ 147 #endif // RE2_UTIL_UTIL_H__
OLDNEW
« no previous file with comments | « third_party/re2/util/sparse_set.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698