23 lines
742 B
Diff
23 lines
742 B
Diff
From b13eb9f3dc96226d2f10a986c7e4d6c565e63c53 Mon Sep 17 00:00:00 2001
|
|
From: Piotr Wójcik <chocimier@tlen.pl>
|
|
Date: Sat, 21 Jan 2023 23:34:10 +0100
|
|
Subject: malloc_trim
|
|
|
|
|
|
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
|
|
index 4950eb90..a3cd7f4e 100644
|
|
--- a/src/plugins/coreplugin/mainwindow.cpp
|
|
+++ b/src/plugins/coreplugin/mainwindow.cpp
|
|
@@ -216,7 +216,7 @@ MainWindow::MainWindow()
|
|
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
|
|
}
|
|
--
|
|
2.39.0
|
|
|