diff --git a/Cargo.toml b/Cargo.toml index a4fe8f59..09282d9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,9 @@ zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" +[target.'cfg(windows)'.dependencies] +mimalloc = "0.1.29" + [dev-dependencies] env_logger = "0.9.0" diff --git a/src/main.rs b/src/main.rs index 506cc478..7a02617e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,10 @@ use cargo_binstall::{ *, }; +#[cfg(windows)] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + #[derive(Debug, Parser)] #[clap(version, about = "Install a Rust binary... from binaries!")] struct Options {