From 944c6761f73f097552042912780104783f9ca62e Mon Sep 17 00:00:00 2001 From: Josh Megnauth Date: Thu, 29 May 2025 00:40:06 -0400 Subject: [PATCH] fix(windows): Mingw doesn't support trim Closes: #872 --- src/app/cosmic.rs | 6 +++--- src/app/mod.rs | 2 +- src/applet/mod.rs | 2 +- src/lib.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index 940030d8..055ff947 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -215,7 +215,7 @@ where crate::Action::DbusActivation(message) => self.app.dbus_activation(message), }; - #[cfg(target_env = "gnu")] + #[cfg(all(target_env = "gnu", not(target_os = "windows")))] crate::malloc::trim(0); message @@ -397,7 +397,7 @@ where self.app.view().map(crate::Action::App) }; - #[cfg(target_env = "gnu")] + #[cfg(all(target_env = "gnu", not(target_os = "windows")))] crate::malloc::trim(0); view @@ -407,7 +407,7 @@ where pub fn view(&self) -> Element> { let view = self.app.view_main(); - #[cfg(target_env = "gnu")] + #[cfg(all(target_env = "gnu", not(target_os = "windows")))] crate::malloc::trim(0); view diff --git a/src/app/mod.rs b/src/app/mod.rs index 31355059..eec9741c 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -96,7 +96,7 @@ pub(crate) fn iced_settings( /// /// Returns error on application failure. pub fn run(settings: Settings, flags: App::Flags) -> iced::Result { - #[cfg(target_env = "gnu")] + #[cfg(all(target_env = "gnu", not(target_os = "windows")))] if let Some(threshold) = settings.default_mmap_threshold { crate::malloc::limit_mmap_threshold(threshold); } diff --git a/src/applet/mod.rs b/src/applet/mod.rs index c44bc483..e0ab993c 100644 --- a/src/applet/mod.rs +++ b/src/applet/mod.rs @@ -460,7 +460,7 @@ pub fn run(flags: App::Flags) -> iced::Result { let mut settings = helper.window_settings(); settings.resizable = None; - #[cfg(target_env = "gnu")] + #[cfg(all(target_env = "gnu", not(target_os = "windows")))] if let Some(threshold) = settings.default_mmap_threshold { crate::malloc::limit_mmap_threshold(threshold); } diff --git a/src/lib.rs b/src/lib.rs index 119d7af5..e8aeeedd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,7 +90,7 @@ pub use iced_wgpu; pub mod icon_theme; pub mod keyboard_nav; -#[cfg(target_env = "gnu")] +#[cfg(all(target_env = "gnu", not(target_os = "windows")))] pub(crate) mod malloc; #[cfg(all(feature = "process", not(windows)))]