X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/9bcd318d5fa2a38139c9651d263a06c797529333..ba379fdc102753d6be2c4d937058fe40257329fe:/interpreter/RegisterFile.cpp diff --git a/interpreter/RegisterFile.cpp b/interpreter/RegisterFile.cpp index 50698f5..cfcf1d3 100644 --- a/interpreter/RegisterFile.cpp +++ b/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