diff --git a/Cargo.lock b/Cargo.lock index d93418e9..4bc55102 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,26 +1864,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" -[[package]] -name = "jemalloc-sys" -version = "0.5.4+5.3.0-patched" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "jemallocator" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc" -dependencies = [ - "jemalloc-sys", - "libc", -] - [[package]] name = "jobserver" version = "0.1.32" @@ -2341,7 +2321,6 @@ dependencies = [ "humantime", "hyper", "hyper-util", - "jemallocator", "jsonschema", "lazy_static", "libc", @@ -2365,6 +2344,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror 2.0.9", + "tikv-jemallocator", "tokio", "tokio-native-tls", "tokio-rustls", @@ -3420,6 +3400,26 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.6.0+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3c60906412afa9c2b5b5a48ca6a5abe5736aec9eb48ad05037a677e52e4e2d" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cec5ff18518d81584f477e9bfdf957f5bb0979b0bac3af4ca30b5b3ae2d2865" +dependencies = [ + "libc", + "tikv-jemalloc-sys", +] + [[package]] name = "time" version = "0.3.37" diff --git a/Cargo.toml b/Cargo.toml index 511fd1ab..a01836fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,9 +71,11 @@ tokio-vsock = { version = "0.5.0", optional = true } rusqlite = { version = "0.32.0", features = ["bundled"] } num_cpus = "1.16.0" +[target.'cfg(not(target_env = "msvc"))'.dependencies] +tikv-jemallocator = "0.6" + [target.'cfg(unix)'.dependencies] rlimit = "0.10.1" -jemallocator = "0.5.4" [target.x86_64-unknown-linux-musl.dependencies] # Workaround for release CI diff --git a/src/main.rs b/src/main.rs index fcc2469a..64d34efa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -33,9 +33,12 @@ mod result_data; mod timescale; mod url_generator; -#[cfg(unix)] +#[cfg(not(target_env = "msvc"))] +use tikv_jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] #[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; +static GLOBAL: Jemalloc = Jemalloc; #[derive(Parser)] #[command(version, about, long_about = None)]