Skip to content

Commit

Permalink
Depend on mimalloc only in musl context
Browse files Browse the repository at this point in the history
  • Loading branch information
jch-13 committed Feb 14, 2025
1 parent 9e778ac commit 468126b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mio = { version = "1.0", features = ["os-poll", "net"] }
min-max-heap = { git = "https://github.com/tov/min-max-heap-rs", branch = "master"}
slab = "0.4"
anyhow = "1.0"
mimalloc = { version = "0.1", default-features = false }
noodles = { version = "0.90", features = ["bam", "bgzf", "core", "cram", "fasta", "fastq", "sam"] }
time = { version = "0.3", features = ["local-offset"] }
flate2 = "1.0"
Expand All @@ -34,6 +33,9 @@ bstr = { version = "1.9", features = ["serde"] }
[patch.crates-io]
bio = { git = "https://github.com/jch-13/rust-bio.git", branch = "occ_small_k" }

[target.'cfg(target_env = "musl")'.dependencies]
mimalloc = { version = "0.1", default-features = false }

[dev-dependencies]
criterion = "0.5"
tempfile = "3.3"
Expand Down
4 changes: 1 addition & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use clap::{crate_authors, crate_description, value_parser, Arg, ArgAction, ArgMatches, Command};
use log::{error, info, warn};
#[cfg(target_env = "musl")]
use mimalloc::MiMalloc;
use simple_logger::SimpleLogger;
use time::UtcOffset;

Expand All @@ -21,7 +19,7 @@ use mapad::{
// Use mimalloc only for musl target
#[cfg(target_env = "musl")]
#[global_allocator]
static ALLOC: MiMalloc = MiMalloc;
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;

fn main() {
handle_arguments(&define_cli());
Expand Down

0 comments on commit 468126b

Please sign in to comment.