From b0531c002c48ae606c6ea88e4ba691ed22940587 Mon Sep 17 00:00:00 2001 From: Yue Ni Date: Sun, 23 Oct 2022 23:49:59 +0800 Subject: [PATCH] Switch from jemalloc to mimalloc to avoid https://github.com/tikv/jemallocator/issues/17 --- Cargo.toml | 4 ++-- lib/vrl/tests/Cargo.toml | 2 +- lib/vrl/tests/src/main.rs | 2 +- src/lib.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8f712951c62a81..7b46450e1e2def 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -300,7 +300,7 @@ socket2 = { version = "0.4.7", default-features = false } stream-cancel = { version = "0.8.1", default-features = false } strip-ansi-escapes = { version = "0.1.1", default-features = false } syslog = { version = "6.0.1", default-features = false, optional = true } -tikv-jemallocator = { version = "0.5.0", default-features = false, optional = true } +mimalloc = { version = "0.1.30", default-features = true, optional = true} tokio-postgres = { version = "0.7.7", default-features = false, features = ["runtime", "with-chrono-0_4"], optional = true } tokio-tungstenite = {version = "0.17.2", default-features = false, features = ["connect"], optional = true} toml = { version = "0.5.9", default-features = false } @@ -401,7 +401,7 @@ target-powerpc64le-unknown-linux-gnu = ["api", "api-client", "enrichment-tables" target-powerpc-unknown-linux-gnu = ["api", "api-client", "enrichment-tables", "rdkafka?/cmake_build", "sinks", "sources", "sources-dnstap", "transforms", "unix", "vrl-cli", "enterprise"] # Enables features that work only on systems providing `cfg(unix)` -unix = ["tikv-jemallocator"] +unix = ["mimalloc"] # Enables kubernetes dependencies and shared code. Kubernetes-related sources, # transforms and sinks should depend on this feature. diff --git a/lib/vrl/tests/Cargo.toml b/lib/vrl/tests/Cargo.toml index 945c6ccd51afae..77348447b60c73 100644 --- a/lib/vrl/tests/Cargo.toml +++ b/lib/vrl/tests/Cargo.toml @@ -26,7 +26,7 @@ serde_json = "1" tracing-subscriber = { version = "0.3.15", default-features = false, features = ["fmt"] } [target.'cfg(not(target_env = "msvc"))'.dependencies] -tikv-jemallocator = { version = "0.5.0" } +mimalloc = { version = "0.1.30" } [features] default = [] diff --git a/lib/vrl/tests/src/main.rs b/lib/vrl/tests/src/main.rs index dde991f5ac29a2..ac999c031b9e3f 100644 --- a/lib/vrl/tests/src/main.rs +++ b/lib/vrl/tests/src/main.rs @@ -23,7 +23,7 @@ use vrl_tests::{docs, Test}; #[cfg(not(target_env = "msvc"))] #[global_allocator] -static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[derive(Parser, Debug)] #[clap(name = "VRL Tests", about = "Vector Remap Language Tests")] diff --git a/src/lib.rs b/src/lib.rs index 94aed1fca000ab..1661b65f9b0abf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -22,9 +22,9 @@ extern crate tracing; #[macro_use] extern crate derivative; -#[cfg(feature = "tikv-jemallocator")] +#[cfg(feature = "mimalloc")] #[global_allocator] -static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; +static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; #[macro_use] #[allow(unreachable_pub)]