From 24b6217897486599bcdad39c3ec030e604ee94fd Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 5 Oct 2023 09:47:22 +0200 Subject: [PATCH] Make jemalloc optional --- Makefile | 4 ++-- syndicate-server/Cargo.toml | 5 ++++- syndicate-server/src/main.rs | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f7c9023..8701bcf 100644 --- a/Makefile +++ b/Makefile @@ -53,7 +53,7 @@ static-%: x86_64-binary: x86_64-binary-release x86_64-binary-release: - cross build --target x86_64-unknown-linux-musl --release --all-targets --features vendored-openssl + cross build --target x86_64-unknown-linux-musl --release --all-targets --features vendored-openssl,jemalloc x86_64-binary-debug: cross build --target x86_64-unknown-linux-musl --all-targets --features vendored-openssl @@ -73,7 +73,7 @@ armv7-binary-debug: aarch64-binary: aarch64-binary-release aarch64-binary-release: - cross build --target=aarch64-unknown-linux-musl --release --all-targets --features vendored-openssl + cross build --target=aarch64-unknown-linux-musl --release --all-targets --features vendored-openssl,jemalloc aarch64-binary-debug: cross build --target=aarch64-unknown-linux-musl --all-targets --features vendored-openssl diff --git a/syndicate-server/Cargo.toml b/syndicate-server/Cargo.toml index 5bcf18b..1b59396 100644 --- a/syndicate-server/Cargo.toml +++ b/syndicate-server/Cargo.toml @@ -9,6 +9,9 @@ homepage = "https://syndicate-lang.org/" repository = "https://git.syndicate-lang.org/syndicate-lang/syndicate-rs" license = "Apache-2.0" +[features] +jemalloc = ["dep:tikv-jemallocator"] + [build-dependencies] preserves-schema = "3.2" syndicate = { path = "../syndicate", version = "0.28.0"} @@ -26,7 +29,7 @@ noise-rust-crypto = "0.5" notify = "4.0" structopt = "0.3" -tikv-jemallocator = "0.5.0" +tikv-jemallocator = { version = "0.5.0", optional = true } tungstenite = "0.13" tokio-tungstenite = "0.14" diff --git a/syndicate-server/src/main.rs b/syndicate-server/src/main.rs index 6382a89..d8a514b 100644 --- a/syndicate-server/src/main.rs +++ b/syndicate-server/src/main.rs @@ -26,6 +26,7 @@ mod protocol; mod script; mod services; +#[cfg(feature = "jemalloc")] #[global_allocator] static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;