Index: third_party/protobuf/src/google/protobuf/arena.h |
diff --git a/third_party/protobuf/src/google/protobuf/arena.h b/third_party/protobuf/src/google/protobuf/arena.h |
index 6a35183ebacb9b0de6788a07fdb42523f02fc10a..cf07b9fc97c0cf4b7f7f4dba9caa5a9edc963833 100644 |
--- a/third_party/protobuf/src/google/protobuf/arena.h |
+++ b/third_party/protobuf/src/google/protobuf/arena.h |
@@ -56,6 +56,7 @@ using type_info = ::type_info; |
#include <google/protobuf/stubs/mutex.h> |
#include <google/protobuf/stubs/type_traits.h> |
+ |
namespace google { |
namespace protobuf { |
@@ -76,7 +77,7 @@ template<typename T> void arena_destruct_object(void* object) { |
template<typename T> void arena_delete_object(void* object) { |
delete reinterpret_cast<T*>(object); |
} |
-inline void arena_free(void* object, size_t size) { |
+inline void arena_free(void* object, size_t /* size */) { |
free(object); |
} |
@@ -210,7 +211,12 @@ struct ArenaOptions { |
// |
// This protocol is implemented by all arena-enabled proto2 message classes as |
// well as RepeatedPtrField. |
+ |
+#if __cplusplus >= 201103L |
+class LIBPROTOBUF_EXPORT Arena final { |
+#else |
class LIBPROTOBUF_EXPORT Arena { |
+#endif |
public: |
// Arena constructor taking custom options. See ArenaOptions below for |
// descriptions of the options available. |
@@ -446,6 +452,10 @@ class LIBPROTOBUF_EXPORT Arena { |
// As above, but does not include any free space in underlying blocks. |
GOOGLE_ATTRIBUTE_NOINLINE uint64 SpaceUsed() const; |
+ // Combines SpaceAllocated and SpaceUsed. Returns a pair of |
+ // <space_allocated, space_used>. |
+ GOOGLE_ATTRIBUTE_NOINLINE pair<uint64, uint64> SpaceAllocatedAndUsed() const; |
+ |
// Frees all storage allocated by this arena after calling destructors |
// registered with OwnDestructor() and freeing objects registered with Own(). |
// Any objects allocated on this arena are unusable after this call. It also |
@@ -507,11 +517,11 @@ class LIBPROTOBUF_EXPORT Arena { |
// |
// This is inside Arena because only Arena has the friend relationships |
// necessary to see the underlying generated code traits. |
- template<typename T> |
- struct is_arena_constructable : |
- public google::protobuf::internal::integral_constant<bool, |
- sizeof(InternalIsArenaConstructableHelper::ArenaConstructable< |
- const T>(static_cast<const T*>(0))) == sizeof(char)> { |
+ template <typename T> |
+ struct is_arena_constructable |
+ : public google::protobuf::internal::integral_constant< |
+ bool, sizeof(InternalIsArenaConstructableHelper::ArenaConstructable< |
+ const T>(static_cast<const T*>(0))) == sizeof(char)> { |
}; |
private: |