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

Unified Diff: third_party/re2/util/sparse_array.h

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/patches/sparse-array-valgrind.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/re2/util/sparse_array.h
diff --git a/third_party/re2/util/sparse_array.h b/third_party/re2/util/sparse_array.h
index 4ee5c949ca25687819646e266d1ca8c3f59fbdac..7bc3a867caf5a7b497b5d1d6986ee5cf8f8d6c08 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/patches/sparse-array-valgrind.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698