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

Unified Diff: third_party/re2/patches/msvc-x64.patch

Issue 11819038: re2 building on x64 windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: just a couple minor non-sign-changing fixes, and disable c4267 Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/re2/patches/msvc-x64.patch
diff --git a/third_party/re2/patches/msvc-x64.patch b/third_party/re2/patches/msvc-x64.patch
new file mode 100644
index 0000000000000000000000000000000000000000..72e0441d10fc0b29f1208c80fb5856809c22734e
--- /dev/null
+++ b/third_party/re2/patches/msvc-x64.patch
@@ -0,0 +1,31 @@
+diff --git a/third_party/re2/re2/dfa.cc b/third_party/re2/re2/dfa.cc
+index 32c8c33..36ec66f 100644
+--- a/third_party/re2/re2/dfa.cc
++++ b/third_party/re2/re2/dfa.cc
+@@ -470,8 +470,8 @@ DFA::DFA(Prog* prog, Prog::MatchKind kind, int64 max_mem)
+ // At minimum, the search requires room for two states in order
+ // to limp along, restarting frequently. We'll get better performance
+ // if there is room for a larger number of states, say 20.
+- int one_state = sizeof(State) + (prog_->size()+nmark)*sizeof(int) +
+- (prog_->bytemap_range()+1)*sizeof(State*);
++ size_t one_state = sizeof(State) + (prog_->size()+nmark)*sizeof(int) +
++ (prog_->bytemap_range()+1)*sizeof(State*);
+ if (state_budget_ < 20*one_state) {
+ LOG(INFO) << StringPrintf("DFA out of memory: prog size %lld mem %lld",
+ prog_->size(), max_mem);
+diff --git a/third_party/re2/util/logging.h b/third_party/re2/util/logging.h
+index 7302ea6..4478f9b 100644
+--- a/third_party/re2/util/logging.h
++++ b/third_party/re2/util/logging.h
+@@ -59,7 +59,11 @@ class LogMessage {
+ void Flush() {
+ stream() << "\n";
+ string s = str_.str();
++#ifdef WIN32
++ write(2, s.data(), static_cast<unsigned int>(s.size()));
++#else
+ if(write(2, s.data(), s.size()) < 0) {} // shut up gcc
++#endif
+ flushed_ = true;
+ }
+ ~LogMessage() {

Powered by Google App Engine
This is Rietveld 408576698