diff options
Diffstat (limited to 'recipes-qt/qt5/qt5-creator/0001-app-Use-malloc_trim-only-on-glibc.patch')
-rw-r--r-- | recipes-qt/qt5/qt5-creator/0001-app-Use-malloc_trim-only-on-glibc.patch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qt5-creator/0001-app-Use-malloc_trim-only-on-glibc.patch b/recipes-qt/qt5/qt5-creator/0001-app-Use-malloc_trim-only-on-glibc.patch new file mode 100644 index 00000000..6ee5b7b5 --- /dev/null +++ b/recipes-qt/qt5/qt5-creator/0001-app-Use-malloc_trim-only-on-glibc.patch @@ -0,0 +1,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 + |