Skip to content

Commit 09ac19b

Browse files
committed
Fix compilation on targets different from linux
1 parent ef684e8 commit 09ac19b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bit-vec = "0.6"
1616
bitvec = "1"
1717
pbr = "*"
1818

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

2222
[dev-dependencies]

src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ use std::collections::HashMap;
1818

1919
use std::time::SystemTime;
2020

21-
#[cfg(not(target_env = "msvc"))]
22-
use tikv_jemallocator::Jemalloc;
23-
24-
#[cfg(not(target_env = "msvc"))]
21+
#[cfg(target_os = "linux")]
2522
#[global_allocator]
26-
static GLOBAL: Jemalloc = Jemalloc;
23+
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
2724

2825
fn main() {
2926
let now = SystemTime::now();

0 commit comments

Comments
 (0)