JDevlieghere created this revision.
JDevlieghere added reviewers: labath, clayborg, kastiglione.
JDevlieghere requested review of this revision.
Remove `ConstString::StaticMemorySize` as it is unused. It is referenced in a
bunch of doc comments but I don't really understand why. My best guess it that
the comments were copy-pasted from `ConstString::MemorySize()` even though it
didn't make sense there either. The implementation of `StaticMemorySize` was
being called on the MemoryPool, not on the ConstString itself.
https://reviews.llvm.org/D118091
Files:
lldb/include/lldb/Core/Declaration.h
lldb/include/lldb/Core/FileSpecList.h
lldb/include/lldb/Core/Mangled.h
lldb/include/lldb/Symbol/Function.h
lldb/include/lldb/Utility/ConstString.h
lldb/include/lldb/Utility/FileSpec.h
lldb/source/Utility/ConstString.cpp
Index: lldb/source/Utility/ConstString.cpp
===================================================================
--- lldb/source/Utility/ConstString.cpp
+++ lldb/source/Utility/ConstString.cpp
@@ -159,18 +159,6 @@
return nullptr;
}
- // Return the size in bytes that this object and any items in its collection
- // of uniqued strings + data count values takes in memory.
- size_t MemorySize() const {
- size_t mem_size = sizeof(Pool);
- for (const auto &pool : m_string_pools) {
- llvm::sys::SmartScopedReader<false> rlock(pool.m_mutex);
- for (const auto &entry : pool.m_string_map)
- mem_size += sizeof(StringPoolEntryType) + entry.getKey().size();
- }
- return mem_size;
- }
-
ConstString::MemoryStats GetMemoryStats() const {
ConstString::MemoryStats stats;
for (const auto &pool : m_string_pools) {
@@ -338,11 +326,6 @@
m_string = StringPool().GetConstTrimmedCStringWithLength(cstr, cstr_len);
}
-size_t ConstString::StaticMemorySize() {
- // Get the size of the static string pool
- return StringPool().MemorySize();
-}
-
ConstString::MemoryStats ConstString::GetMemoryStats() {
return StringPool().GetMemoryStats();
}
Index: lldb/include/lldb/Utility/FileSpec.h
===================================================================
--- lldb/include/lldb/Utility/FileSpec.h
+++ lldb/include/lldb/Utility/FileSpec.h
@@ -334,8 +334,6 @@
///
/// \return
/// The number of bytes that this object occupies in memory.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const;
/// Change the file specified with a new path.
Index: lldb/include/lldb/Utility/ConstString.h
===================================================================
--- lldb/include/lldb/Utility/ConstString.h
+++ lldb/include/lldb/Utility/ConstString.h
@@ -394,20 +394,8 @@
///
/// \return
/// The number of bytes that this object occupies in memory.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const { return sizeof(ConstString); }
- /// Get the size in bytes of the current global string pool.
- ///
- /// Reports the size in bytes of all shared C string values, containers and
- /// any other values as a byte size for the entire string pool.
- ///
- /// \return
- /// The number of bytes that the global string pool occupies
- /// in memory.
- static size_t StaticMemorySize();
-
struct MemoryStats {
size_t GetBytesTotal() const { return bytes_total; }
size_t GetBytesUsed() const { return bytes_used; }
Index: lldb/include/lldb/Symbol/Function.h
===================================================================
--- lldb/include/lldb/Symbol/Function.h
+++ lldb/include/lldb/Symbol/Function.h
@@ -110,8 +110,6 @@
/// The number of bytes that this object occupies in memory.
/// The returned value does not include the bytes for any
/// shared string values.
- ///
- /// \see ConstString::StaticMemorySize ()
virtual size_t MemorySize() const;
protected:
@@ -238,8 +236,6 @@
/// The number of bytes that this object occupies in memory.
/// The returned value does not include the bytes for any
/// shared string values.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const override;
private:
@@ -595,8 +591,6 @@
/// The number of bytes that this object occupies in memory.
/// The returned value does not include the bytes for any
/// shared string values.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const;
/// Get whether compiler optimizations were enabled for this function
Index: lldb/include/lldb/Core/Mangled.h
===================================================================
--- lldb/include/lldb/Core/Mangled.h
+++ lldb/include/lldb/Core/Mangled.h
@@ -183,8 +183,6 @@
///
/// \return
/// The number of bytes that this object occupies in memory.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const;
/// Set the string value in this object.
Index: lldb/include/lldb/Core/FileSpecList.h
===================================================================
--- lldb/include/lldb/Core/FileSpecList.h
+++ lldb/include/lldb/Core/FileSpecList.h
@@ -152,8 +152,6 @@
///
/// \return
/// The number of bytes that this object occupies in memory.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const;
bool IsEmpty() const { return m_files.empty(); }
Index: lldb/include/lldb/Core/Declaration.h
===================================================================
--- lldb/include/lldb/Core/Declaration.h
+++ lldb/include/lldb/Core/Declaration.h
@@ -152,8 +152,6 @@
/// The number of bytes that this object occupies in memory.
/// The returned value does not include the bytes for any
/// shared string values.
- ///
- /// \see ConstString::StaticMemorySize ()
size_t MemorySize() const;
/// Set accessor for the declaration file specification.
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits