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

Unified Diff: third_party/protobuf/patches/0008-uninline_getemptystring_and_getemptystringalreadyinited.patch

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Update to new HEAD (b7632464b4) + restore GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER Created 4 years, 1 month 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/protobuf/patches/0008-uninline_getemptystring_and_getemptystringalreadyinited.patch
diff --git a/third_party/protobuf/patches/0008-uninline_getemptystring_and_getemptystringalreadyinited.patch b/third_party/protobuf/patches/0008-uninline_getemptystring_and_getemptystringalreadyinited.patch
new file mode 100644
index 0000000000000000000000000000000000000000..11d10461f88a33dacb402785bba9b03991c132a8
--- /dev/null
+++ b/third_party/protobuf/patches/0008-uninline_getemptystring_and_getemptystringalreadyinited.patch
@@ -0,0 +1,41 @@
+diff --git a/src/google/protobuf/generated_message_util.cc b/src/google/protobuf/generated_message_util.cc
+index 73f5592..c4c8eef 100644
+--- a/src/google/protobuf/generated_message_util.cc
++++ b/src/google/protobuf/generated_message_util.cc
+@@ -60,6 +60,15 @@ void InitEmptyString() {
+ OnShutdown(&DeleteEmptyString);
+ }
+
++const ::std::string& GetEmptyStringAlreadyInited() {
Peter Kasting 2016/11/22 20:28:23 How come you switched to deinlining this? It seem
jbriance 2016/11/22 22:11:31 fixed_address_empty_string is not exported, and th
++ return fixed_address_empty_string.get();
++}
++
++const ::std::string& GetEmptyString() {
++ ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
++ return GetEmptyStringAlreadyInited();
++}
++
+ int StringSpaceUsedExcludingSelf(const string& str) {
+ const void* start = &str;
+ const void* end = &str + 1;
+diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h
+index 8dc64c4..fda2631 100644
+--- a/src/google/protobuf/generated_message_util.h
++++ b/src/google/protobuf/generated_message_util.h
+@@ -116,14 +116,9 @@ LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_once_init_;
+ LIBPROTOBUF_EXPORT void InitEmptyString();
+
+
+-LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() {
+- return fixed_address_empty_string.get();
+-}
++LIBPROTOBUF_EXPORT const ::std::string& GetEmptyStringAlreadyInited();
+
+-LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyString() {
+- ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString);
+- return GetEmptyStringAlreadyInited();
+-}
++LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString();
+
+ LIBPROTOBUF_EXPORT int StringSpaceUsedExcludingSelf(const string& str);
+

Powered by Google App Engine
This is Rietveld 408576698