diff options
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | absl/base/internal/malloc_extension.cc | 7 | ||||
-rw-r--r-- | absl/base/internal/malloc_extension.h | 7 |
3 files changed, 11 insertions, 7 deletions
diff --git a/README.md b/README.md index c6db64ab450f..9d75b67d4438 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,3 @@ For more information about Abseil: * Peruse our [Abseil Compatibility Guarantees](http://abseil.io/about/compatibility) to understand both what we promise to you, and what we expect of you in return. - -## Disclaimer - -* This is not an official Google product. diff --git a/absl/base/internal/malloc_extension.cc b/absl/base/internal/malloc_extension.cc index 3da981ce06a3..d48ec5bcf548 100644 --- a/absl/base/internal/malloc_extension.cc +++ b/absl/base/internal/malloc_extension.cc @@ -29,6 +29,13 @@ namespace base_internal { SysAllocator::~SysAllocator() {} void SysAllocator::GetStats(char* buffer, int) { buffer[0] = 0; } +// Dummy key method to avoid weak vtable. +void MallocExtensionWriter::UnusedKeyMethod() {} + +void StringMallocExtensionWriter::Write(const char* buf, int len) { + out_->append(buf, len); +} + // Default implementation -- does nothing MallocExtension::~MallocExtension() { } bool MallocExtension::VerifyAllMemory() { return true; } 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_; |