aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/extension_set.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/extension_set.h')
-rw-r--r--src/google/protobuf/extension_set.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h
index 1acc2c5c..9ad241f2 100644
--- a/src/google/protobuf/extension_set.h
+++ b/src/google/protobuf/extension_set.h
@@ -209,6 +209,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
void Clear();
void MergeFrom(const ExtensionSet& other);
+ void Swap(ExtensionSet* other);
bool IsInitialized() const;
// These parsing and serialization functions all want a pointer to the
@@ -234,6 +235,10 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
// Returns the total serialized size of all the extensions.
int ByteSize(const Message& message) const;
+ // Returns (an estimate of) the total number of bytes used for storing the
+ // extensions in memory, excluding sizeof(*this).
+ int SpaceUsedExcludingSelf() const;
+
private:
// Like FindKnownExtension(), but GOOGLE_CHECK-fail if not found.
const FieldDescriptor* FindKnownExtensionOrDie(int number) const;
@@ -286,6 +291,7 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
void Clear();
int GetSize() const;
void Free();
+ int SpaceUsedExcludingSelf() const;
};
// The Extension struct is small enough to be passed by value, so we use it