Skip to content

Commit

Permalink
starknet: add jemalloc feature
Browse files Browse the repository at this point in the history
  • Loading branch information
fracek committed Jun 10, 2024
1 parent c9eb5ce commit ffd3cdb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions starknet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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" }
Expand Down
2 changes: 1 addition & 1 deletion starknet/src/bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ffd3cdb

Please sign in to comment.