aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/arena.h
diff options
context:
space:
mode:
authorJisi Liu <jisi.liu@gmail.com>2016-04-28 14:34:59 -0700
committerJisi Liu <jisi.liu@gmail.com>2016-04-28 14:34:59 -0700
commitcf14183bcd5485b4a71541599ddce0b35eb71352 (patch)
tree12f6e5eb731d7a70cdac4cdafc8b3131629413e2 /src/google/protobuf/arena.h
parentf00300d7f04f1c38a7d70e271f9232b94dd0e326 (diff)
downloadprotobuf-cf14183bcd5485b4a71541599ddce0b35eb71352.tar.gz
protobuf-cf14183bcd5485b4a71541599ddce0b35eb71352.tar.bz2
protobuf-cf14183bcd5485b4a71541599ddce0b35eb71352.zip
Down integrate from Google internal.
Diffstat (limited to 'src/google/protobuf/arena.h')
-rw-r--r--src/google/protobuf/arena.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h
index 9ab0a0f9..b3d66d91 100644
--- a/src/google/protobuf/arena.h
+++ b/src/google/protobuf/arena.h
@@ -211,7 +211,12 @@ struct ArenaOptions {
//
// This protocol is implemented by all arena-enabled proto2 message classes as
// well as RepeatedPtrField.
+
+#if __cplusplus >= 201103L
+class Arena final {
+#else
class LIBPROTOBUF_EXPORT Arena {
+#endif
public:
// Arena constructor taking custom options. See ArenaOptions below for
// descriptions of the options available.
@@ -231,7 +236,6 @@ class LIBPROTOBUF_EXPORT Arena {
// if it was passed in.
~Arena();
-
// API to create proto2 message objects on the arena. If the arena passed in
// is NULL, then a heap allocated object is returned. Type T must be a message
// defined in a .proto file with cc_enable_arenas set to true, otherwise a
@@ -448,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