From d42fb6d1b94be9c6184ea1cdff98f13549dee22b Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 30 Jun 2021 05:15:26 +0400 Subject: [PATCH] Switch from mallocng to jemalloc Now it's known how to make it free the memory in an expected manner and it's better maintained --- .gitmodules | 3 --- Telegram/CMakeLists.txt | 1 - Telegram/SourceFiles/platform/linux/specific_linux.cpp | 4 ++++ Telegram/ThirdParty/mallocng | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) delete mode 160000 Telegram/ThirdParty/mallocng diff --git a/.gitmodules b/.gitmodules index f7b50ce418..de0d2fa961 100644 --- a/.gitmodules +++ b/.gitmodules @@ -88,9 +88,6 @@ [submodule "Telegram/lib_webview"] path = Telegram/lib_webview url = https://github.com/desktop-app/lib_webview.git -[submodule "Telegram/ThirdParty/mallocng"] - path = Telegram/ThirdParty/mallocng - url = https://github.com/desktop-app/mallocng.git [submodule "Telegram/lib_waylandshells"] path = Telegram/lib_waylandshells url = https://github.com/desktop-app/lib_waylandshells.git diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index f466ec1af6..0b1e6f907a 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -87,7 +87,6 @@ if (LINUX) PRIVATE desktop-app::external_glibmm desktop-app::external_glib - desktop-app::external_mallocng ) if (NOT DESKTOP_APP_DISABLE_DBUS_INTEGRATION) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 6fd38f5c7f..52b3df380b 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -48,6 +48,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include #include +#include #include #include @@ -740,6 +741,9 @@ int psFixPrevious() { namespace Platform { void start() { + auto backgroundThread = true; + mallctl("background_thread", nullptr, nullptr, &backgroundThread, sizeof(bool)); + LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName())); #ifndef DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION diff --git a/Telegram/ThirdParty/mallocng b/Telegram/ThirdParty/mallocng deleted file mode 160000 index 5413b277e2..0000000000 --- a/Telegram/ThirdParty/mallocng +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5413b277e2add1a2e5086ad75071277390770a3a