Skip to content

Commit

Permalink
Fix compilation on targets different from linux
Browse files Browse the repository at this point in the history
  • Loading branch information
yp committed Feb 7, 2024
1 parent ef684e8 commit 09ac19b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bit-vec = "0.6"
bitvec = "1"
pbr = "*"

[target.'cfg(not(target_env = "msvc"))'.dependencies]
[target.'cfg(target_os="linux")'.dependencies]
tikv-jemallocator = "0.5"

[dev-dependencies]
Expand Down
7 changes: 2 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ use std::collections::HashMap;

use std::time::SystemTime;

#[cfg(not(target_env = "msvc"))]
use tikv_jemallocator::Jemalloc;

#[cfg(not(target_env = "msvc"))]
#[cfg(target_os = "linux")]
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

fn main() {
let now = SystemTime::now();
Expand Down

0 comments on commit 09ac19b

Please sign in to comment.