From 3bd691a4975b2267ff04611507e766a7f9f87e83 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 8 May 2015 16:56:29 -0700 Subject: Google-internal development. --- upb/bindings/googlepb/proto2.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'upb/bindings/googlepb/proto2.cc') diff --git a/upb/bindings/googlepb/proto2.cc b/upb/bindings/googlepb/proto2.cc index 3911172..87c13b6 100644 --- a/upb/bindings/googlepb/proto2.cc +++ b/upb/bindings/googlepb/proto2.cc @@ -946,14 +946,14 @@ case goog::FieldDescriptor::cpptype: \ public: typedef goog::Message Type; #ifdef GOOGLE_PROTOBUF_HAS_ARENAS - static ::proto2::Arena* GetArena(Type* t) { + static goog::Arena* GetArena(Type* t) { return t->GetArena(); } static void* GetMaybeArenaPointer(Type* t) { return t->GetMaybeArenaPointer(); } static inline Type* NewFromPrototype( - const Type* prototype, ::proto2::Arena* arena = NULL) { + const Type* prototype, goog::Arena* arena = NULL) { return prototype->New(arena); } static void Delete(Type* t, goog::Arena* arena = NULL) { @@ -1277,6 +1277,11 @@ case goog::FieldDescriptor::cpptype: \ return lazy_field_.SetAllocated(static_cast(message)); } + virtual void UnsafeArenaSetAllocatedMessage(proto2::MessageLite* message) { + return lazy_field_.UnsafeArenaSetAllocated( + static_cast(message)); + } + virtual proto2::MessageLite* ReleaseMessage( const proto2::MessageLite& prototype) { return lazy_field_.ReleaseByPrototype( -- cgit v1.2.3