Use mimalloc as the global memory allocator (#2723)

* Experimenting with mimalloc as the global allocator for desktop

* Format toml file
This commit is contained in:
Consoli
2024-09-25 16:18:37 -03:00
committed by GitHub
parent e7dba1e84f
commit aff2eddcb0
4 changed files with 7 additions and 0 deletions

BIN
Cargo.lock generated
View File

Binary file not shown.

View File

@@ -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"

View File

@@ -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"

View File

@@ -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};