OLD | NEW |
---|---|
(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 | |
OLD | NEW |