<rdar://problem/10584789>
Added a static memory pressure function in SBDebugger:
void SBDebugger::MemoryPressureDetected ()
This can be called by applications that detect memory pressure to cause LLDB to release cached information.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146640 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/lldb/API/SBDebugger.h b/include/lldb/API/SBDebugger.h
index f778187..0f01908 100644
--- a/include/lldb/API/SBDebugger.h
+++ b/include/lldb/API/SBDebugger.h
@@ -35,6 +35,9 @@
static void
Destroy (lldb::SBDebugger &debugger);
+ static void
+ MemoryPressureDetected ();
+
SBDebugger();
SBDebugger(const lldb::SBDebugger &rhs);
diff --git a/scripts/Python/interface/SBDebugger.i b/scripts/Python/interface/SBDebugger.i
index 184109b..1882021 100644
--- a/scripts/Python/interface/SBDebugger.i
+++ b/scripts/Python/interface/SBDebugger.i
@@ -122,6 +122,9 @@
static void
Destroy (lldb::SBDebugger &debugger);
+ static void
+ MemoryPressureDetected();
+
SBDebugger();
SBDebugger(const lldb::SBDebugger &rhs);
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index b8be227..65357bb 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -124,6 +124,12 @@
debugger.m_opaque_sp.reset();
}
+void
+SBDebugger::MemoryPressureDetected ()
+{
+ ModuleList::RemoveOrphanSharedModules();
+}
+
SBDebugger::SBDebugger () :
m_opaque_sp ()
{