Chromium Code Reviews| 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); |
| + |