aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qt5-creator/0001-app-Use-malloc_trim-only-on-glibc.patch
blob: 6ee5b7b5712a842791e1ef0c088f8a58b91d902b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 46ec546fdc4427019184f84f24efe3e145b7e40f Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 11 Aug 2020 21:19:22 -0700
Subject: [PATCH] app: Use malloc_trim only on glibc

musl does not implement it

Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 src/app/main.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/app/main.cpp b/src/app/main.cpp
index 419b9b362a..9e150e7613 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -719,7 +719,11 @@ int main(int argc, char **argv)
             m_trimTimer.setSingleShot(true);
             m_trimTimer.setInterval(60000);
             // glibc may not actually free memory in free().
+#ifdef __GLIBC__
             connect(&m_trimTimer, &QTimer::timeout, this, [] { malloc_trim(0); });
+#else
+            connect(&m_trimTimer, &QTimer::timeout, this, [] { });
+#endif
         }
 
         bool eventFilter(QObject *, QEvent *e) override
-- 
2.28.0