Skip to content

Commit d31fdb0

Browse files
Only use jemalloc without MSVC (#11739)
1 parent 3881e6b commit d31fdb0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ spdx = "=0.10.9"
125125
tar = "=0.4.44"
126126
tempfile = "=3.20.0"
127127
thiserror = "=2.0.12"
128-
tikv-jemallocator = { version = "=0.6.0", features = ['unprefixed_malloc_on_supported_platforms', 'profiling'] }
129128
tokio = { version = "=1.47.1", features = ["net", "signal", "io-std", "io-util", "rt-multi-thread", "macros", "process"]}
130129
tokio-postgres = "=0.7.13"
131130
tokio-util = "=0.7.16"
@@ -139,6 +138,9 @@ url = "=2.5.4"
139138
utoipa = { version = "=5.4.0", features = ["chrono"] }
140139
utoipa-axum = "=0.2.0"
141140

141+
[target.'cfg(not(target_env = "msvc"))'.dependencies]
142+
tikv-jemallocator = { version = "=0.6.0", features = ['unprefixed_malloc_on_supported_platforms', 'profiling'] }
143+
142144
[dev-dependencies]
143145
bytes = "=1.10.1"
144146
crates_io_docs_rs = { path = "crates/crates_io_docs_rs", features = ["mock"] }

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ use std::sync::Arc;
1010

1111
use crate::app::AppState;
1212
use crate::router::build_axum_router;
13+
#[cfg(not(target_env = "msvc"))]
1314
use tikv_jemallocator::Jemalloc;
1415

16+
#[cfg(not(target_env = "msvc"))]
1517
#[global_allocator]
1618
static ALLOC: Jemalloc = Jemalloc;
1719

0 commit comments

Comments
 (0)