Skip to content

Commit

Permalink
Merge pull request #206 from passcod/mimalloc-on-windows
Browse files Browse the repository at this point in the history
Add mimalloc on feature flag
  • Loading branch information
passcod authored Jul 6, 2022
2 parents 3348d3d + 63afa5b commit 3c06c45
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ futures-util = { version = "0.3.21", default-features = false }
home = "0.5.3"
log = "0.4.14"
miette = { version = "5.1.0", features = ["fancy-no-backtrace"] }
mimalloc = { version = "0.1.29", default-features = false, optional = true }
once_cell = "1.12.0"
reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false }
scopeguard = "1.1.0"
Expand Down Expand Up @@ -68,6 +69,10 @@ 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"

[features]
default = []
mimalloc = ["dep:mimalloc"]

[dev-dependencies]
env_logger = "0.9.0"

Expand Down
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ use cargo_binstall::{
*,
};

#[cfg(feature = "mimalloc")]
#[global_allocator]
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;

#[derive(Debug, Parser)]
#[clap(version, about = "Install a Rust binary... from binaries!")]
struct Options {
Expand Down

0 comments on commit 3c06c45

Please sign in to comment.