Use mimalloc on windows

This commit is contained in:
Félix Saparelli 2022-07-05 23:10:57 +12:00
parent 3348d3d7a2
commit fe724585ae
No known key found for this signature in database
GPG key ID: B948C4BAE44FC474
2 changed files with 7 additions and 0 deletions

View file

@ -68,6 +68,9 @@ zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features
[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies]
guess_host_triple = "0.1.3" guess_host_triple = "0.1.3"
[target.'cfg(windows)'.dependencies]
mimalloc = "0.1.29"
[dev-dependencies] [dev-dependencies]
env_logger = "0.9.0" env_logger = "0.9.0"

View file

@ -25,6 +25,10 @@ use cargo_binstall::{
*, *,
}; };
#[cfg(windows)]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[clap(version, about = "Install a Rust binary... from binaries!")] #[clap(version, about = "Install a Rust binary... from binaries!")]
struct Options { struct Options {