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

Unified Diff: third_party/re2/patches/sparse-array-valgrind.patch

Issue 1509953005: re2: Initialize sparse_to_dense_ on initial allocation under Valgrind. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/re2/README.chromium ('k') | third_party/re2/util/sparse_array.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/patches/sparse-array-valgrind.patch
diff --git a/third_party/re2/patches/sparse-array-valgrind.patch b/third_party/re2/patches/sparse-array-valgrind.patch
new file mode 100644
index 0000000000000000000000000000000000000000..e2cf0bd35256d97cdcf7714d2884c521f5daf0e1
--- /dev/null
+++ b/third_party/re2/patches/sparse-array-valgrind.patch
@@ -0,0 +1,23 @@
+diff --git a/third_party/re2/util/sparse_array.h b/third_party/re2/util/sparse_array.h
+index 4ee5c94..7bc3a86 100644
+--- a/third_party/re2/util/sparse_array.h
++++ b/third_party/re2/util/sparse_array.h
+@@ -273,13 +273,13 @@ void SparseArray<Value>::resize(int new_max_size) {
+ int* a = new int[new_max_size];
+ if (sparse_to_dense_) {
+ memmove(a, sparse_to_dense_, max_size_*sizeof a[0]);
+- // Don't need to zero the memory but appease Valgrind.
+- if (valgrind_) {
+- for (int i = max_size_; i < new_max_size; i++)
+- a[i] = 0xababababU;
+- }
+ delete[] sparse_to_dense_;
+ }
++ // Don't need to zero the memory but appease Valgrind.
++ if (valgrind_) {
++ for (int i = max_size_; i < new_max_size; i++)
++ a[i] = 0xababababU;
++ }
+ sparse_to_dense_ = a;
+
+ dense_.resize(new_max_size);
« no previous file with comments | « third_party/re2/README.chromium ('k') | third_party/re2/util/sparse_array.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698