From ffd3cdbf57c165db42f8fb1b884f43d9e99efcb7 Mon Sep 17 00:00:00 2001 From: Francesco Ceccon Date: Mon, 10 Jun 2024 16:52:01 +0200 Subject: [PATCH] starknet: add jemalloc feature --- starknet/Cargo.toml | 8 +++++--- starknet/src/bin.rs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/starknet/Cargo.toml b/starknet/Cargo.toml index 34aaebe2..31479b8f 100644 --- a/starknet/Cargo.toml +++ b/starknet/Cargo.toml @@ -14,6 +14,10 @@ path = "src/lib.rs" name = "apibara-starknet" path = "src/bin.rs" +[features] +default = ["jemalloc"] +jemalloc = ["dep:jemallocator"] + [dependencies] apibara-core = { path = "../core" } apibara-node = { path = "../node" } @@ -48,9 +52,7 @@ tracing.workspace = true tracing-futures.workspace = true url = "2.2.2" warp.workspace = true - -[target.'cfg(not(windows))'.dependencies] -jemallocator.workspace = true +jemallocator = { workspace = true, optional = true } [dev-dependencies] apibara-core = { path = "../core" } diff --git a/starknet/src/bin.rs b/starknet/src/bin.rs index b0ac373f..66b43b45 100644 --- a/starknet/src/bin.rs +++ b/starknet/src/bin.rs @@ -4,7 +4,7 @@ use clap::{Parser, Subcommand}; use error_stack::{Result, ResultExt}; use tokio_util::sync::CancellationToken; -#[cfg(not(windows))] +#[cfg(feature = "jemalloc")] #[global_allocator] static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;