Skip to content

Commit

Permalink
Switch from jemalloc to mimalloc to avoid tikv/jemallocator#17
Browse files Browse the repository at this point in the history
  • Loading branch information
niyue committed Oct 25, 2022
1 parent 324dcfb commit b715b1d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,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 }
Expand Down Expand Up @@ -403,7 +403,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.
Expand Down
2 changes: 1 addition & 1 deletion lib/vrl/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ serde_json = "1"
tracing-subscriber = { version = "0.3.16", 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 = []
2 changes: 1 addition & 1 deletion lib/vrl/tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit b715b1d

Please sign in to comment.