about summary refs log tree commit diff
path: root/absl/base/internal/malloc_extension.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/base/internal/malloc_extension.h')
-rw-r--r--absl/base/internal/malloc_extension.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/absl/base/internal/malloc_extension.h b/absl/base/internal/malloc_extension.h
index 46b767ff2c3f..75a00ce9a78d 100644
--- a/absl/base/internal/malloc_extension.h
+++ b/absl/base/internal/malloc_extension.h
@@ -388,6 +388,9 @@ class MallocExtensionWriter {
   MallocExtensionWriter() {}
   MallocExtensionWriter(const MallocExtensionWriter&) = delete;
   MallocExtensionWriter& operator=(const MallocExtensionWriter&) = delete;
+
+ private:
+  virtual void UnusedKeyMethod();  // Dummy key method to avoid weak vtable.
 };
 
 // A subclass that writes to the std::string "out".  NOTE: The generated
@@ -396,9 +399,7 @@ class MallocExtensionWriter {
 class StringMallocExtensionWriter : public MallocExtensionWriter {
  public:
   explicit StringMallocExtensionWriter(std::string* out) : out_(out) {}
-  virtual void Write(const char* buf, int len) {
-    out_->append(buf, len);
-  }
+  void Write(const char* buf, int len) override;
 
  private:
   std::string* const out_;