diff --git a/Cargo.lock b/Cargo.lock index 5118f358b..1854190fb 100644 Binary files a/Cargo.lock and b/Cargo.lock differ diff --git a/Cargo.toml b/Cargo.toml index bf23e5190..c8a312cc0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,7 @@ image = "0.24.9" # Update bl itertools = "0.13.0" lending-stream = "1.0" libc = "0.2" +mimalloc = "0.1.43" normpath = "1.2" once_cell = "1.19" pin-project-lite = "0.2.14" diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml index dbf441ec7..49d7ded48 100644 --- a/apps/desktop/src-tauri/Cargo.toml +++ b/apps/desktop/src-tauri/Cargo.toml @@ -41,6 +41,9 @@ tauri-plugin-os = "=2.0.0-rc.0" tauri-plugin-shell = "=2.0.0-rc.0" tauri-plugin-updater = "=2.0.0-rc.0" +# memory allocator +mimalloc = { workspace = true } + [dependencies.tauri] features = ["linux-libxdo", "macos-private-api", "native-tls-vendored", "unstable"] version = "=2.0.0-rc.2" diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index b4fde3828..a1701893e 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -3,6 +3,9 @@ windows_subsystem = "windows" )] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + use std::{fs, path::PathBuf, process::Command, sync::Arc, time::Duration}; use menu::{set_enabled, MenuEvent};