aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xiaofeng@google.com>2015-09-16 14:44:48 -0700
committerGravatar Feng Xiao <xiaofeng@google.com>2015-09-16 14:44:48 -0700
commitc9418912cb5483551fecde5463c56a0ae40830fb (patch)
treeeece39efb652a51a6fe3e313bae890dc9c8f45da
parentfbabf987e671aa37d11e1163e0175f99b32df5fe (diff)
parentd41a3d630c529c61a1a01ba95867965744b4cc12 (diff)
Merge pull request #813 from 0xAAE/master
Add GOOGLE_ATTRIBUTE_NOINLINE to GetArena() and GetMaybeArenaPointer(…
-rw-r--r--src/google/protobuf/message.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc
index 2f6416d0..9a586783 100644
--- a/src/google/protobuf/message.cc
+++ b/src/google/protobuf/message.cc
@@ -495,11 +495,19 @@ Message* GenericTypeHandler<Message>::NewFromPrototype(
return prototype->New(arena);
}
template<>
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240
+GOOGLE_ATTRIBUTE_NOINLINE
+#endif
google::protobuf::Arena* GenericTypeHandler<Message>::GetArena(
Message* value) {
return value->GetArena();
}
template<>
+#if defined(_MSC_VER) && (_MSC_VER >= 1900)
+// Note: force noinline to workaround MSVC 2015 compiler bug, issue #240
+GOOGLE_ATTRIBUTE_NOINLINE
+#endif
void* GenericTypeHandler<Message>::GetMaybeArenaPointer(
Message* value) {
return value->GetMaybeArenaPointer();