From afc7f7f58a04fb20cbfc14acb073678f0b585b7a Mon Sep 17 00:00:00 2001 From: Lemmy Date: Sat, 9 May 2026 23:56:46 -0400 Subject: [PATCH] compat: improve non glibc support --- src/app/application.cpp | 4 ++-- src/ipc/ipc_client.cpp | 1 + src/ipc/ipc_service.cpp | 1 + src/shell/panel/panel_manager.cpp | 2 -- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/application.cpp b/src/app/application.cpp index c13a60508..089d1dfe8 100644 --- a/src/app/application.cpp +++ b/src/app/application.cpp @@ -268,7 +268,9 @@ void Application::run() { runStartupPhase("telemetry enqueue", [this]() { m_telemetryService.maybeSend(m_configService, m_httpClient, m_wayland); }); +#ifdef __GLIBC__ runStartupPhase("malloc_trim", []() { malloc_trim(0); }); +#endif m_trayInitTimer.start(std::chrono::milliseconds(500), [this]() { startTrayService(); }); m_polkitInitTimer.start(std::chrono::milliseconds(0), [this]() { syncPolkitAgent(); }); @@ -987,8 +989,6 @@ void Application::initUi() { m_fileDialogPopup.requestLayout(); }); - m_configService.addReloadCallback([]() { malloc_trim(0); }); - m_timeService.setTickSecondCallback([this]() { m_wallpaper.onSecondTick(); if (m_lockScreen.isActive()) { diff --git a/src/ipc/ipc_client.cpp b/src/ipc/ipc_client.cpp index 2bae75f8d..b6cfa62f7 100644 --- a/src/ipc/ipc_client.cpp +++ b/src/ipc/ipc_client.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include diff --git a/src/ipc/ipc_service.cpp b/src/ipc/ipc_service.cpp index 50825fab3..62fcc0ee9 100644 --- a/src/ipc/ipc_service.cpp +++ b/src/ipc/ipc_service.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include diff --git a/src/shell/panel/panel_manager.cpp b/src/shell/panel/panel_manager.cpp index b2057b606..f1556d3b7 100644 --- a/src/shell/panel/panel_manager.cpp +++ b/src/shell/panel/panel_manager.cpp @@ -690,8 +690,6 @@ void PanelManager::destroyPanel() { if (m_platform != nullptr) { m_platform->stopKeyRepeat(); } - - malloc_trim(0); } void PanelManager::togglePanel(const std::string& panelId, PanelOpenRequest request) {