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

Side by Side 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 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 unified diff | Download patch
OLDNEW
(Empty)
1 diff --git a/src/google/protobuf/generated_message_util.cc b/src/google/protobuf /generated_message_util.cc
2 index 73f5592..c4c8eef 100644
3 --- a/src/google/protobuf/generated_message_util.cc
4 +++ b/src/google/protobuf/generated_message_util.cc
5 @@ -60,6 +60,15 @@ void InitEmptyString() {
6 OnShutdown(&DeleteEmptyString);
7 }
8
9 +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
10 + return fixed_address_empty_string.get();
11 +}
12 +
13 +const ::std::string& GetEmptyString() {
14 + ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString );
15 + return GetEmptyStringAlreadyInited();
16 +}
17 +
18 int StringSpaceUsedExcludingSelf(const string& str) {
19 const void* start = &str;
20 const void* end = &str + 1;
21 diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/ generated_message_util.h
22 index 8dc64c4..fda2631 100644
23 --- a/src/google/protobuf/generated_message_util.h
24 +++ b/src/google/protobuf/generated_message_util.h
25 @@ -116,14 +116,9 @@ LIBPROTOBUF_EXPORT extern ProtobufOnceType empty_string_onc e_init_;
26 LIBPROTOBUF_EXPORT void InitEmptyString();
27
28
29 -LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyStringAlreadyInited() {
30 - return fixed_address_empty_string.get();
31 -}
32 +LIBPROTOBUF_EXPORT const ::std::string& GetEmptyStringAlreadyInited();
33
34 -LIBPROTOBUF_EXPORT inline const ::std::string& GetEmptyString() {
35 - ::google::protobuf::GoogleOnceInit(&empty_string_once_init_, &InitEmptyString );
36 - return GetEmptyStringAlreadyInited();
37 -}
38 +LIBPROTOBUF_EXPORT const ::std::string& GetEmptyString();
39
40 LIBPROTOBUF_EXPORT int StringSpaceUsedExcludingSelf(const string& str);
41
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698