void-packages/srcpkgs/qtcreator/patches/musl-no-malloc_trim.patch

15 lines
542 B
Diff

diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp
index 1c04ebd2..d2ab425c 100644
--- a/src/plugins/coreplugin/icore.cpp
+++ b/src/plugins/coreplugin/icore.cpp
@@ -1274,7 +1274,7 @@ void ICorePrivate::init()
m_trimTimer.setSingleShot(true);
m_trimTimer.setInterval(60000);
// glibc may not actually free memory in free().
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && defined(__GLIBC__)
connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); });
#endif
}