summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/interpreter/RegisterFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/interpreter/RegisterFile.cpp')
-rw-r--r--JavaScriptCore/interpreter/RegisterFile.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/JavaScriptCore/interpreter/RegisterFile.cpp b/JavaScriptCore/interpreter/RegisterFile.cpp
index 50698f5..cfcf1d3 100644
--- a/JavaScriptCore/interpreter/RegisterFile.cpp
+++ b/JavaScriptCore/interpreter/RegisterFile.cpp
@@ -42,4 +42,15 @@ RegisterFile::~RegisterFile()
#endif
}
+void RegisterFile::releaseExcessCapacity()
+{
+#if HAVE(MMAP) && HAVE(MADV_FREE) && !HAVE(VIRTUALALLOC)
+ while (madvise(m_start, (m_max - m_start) * sizeof(Register), MADV_FREE) == -1 && errno == EAGAIN) { }
+#elif HAVE(VIRTUALALLOC)
+ VirtualFree(m_start, (m_max - m_start) * sizeof(Register), MEM_DECOMMIT);
+ m_commitEnd = m_start;
+#endif
+ m_maxUsed = m_start;
+}
+
} // namespace JSC