make jemalloc dependency really optional (#101)

Signed-off-by: Sebastien Marie <semarie@online.fr>
This commit is contained in:
Landry Breuil
2022-08-03 11:57:00 +02:00
committed by GitHub
parent da6271a331
commit 019b100521
2 changed files with 9 additions and 1 deletions

View File

@@ -16,7 +16,6 @@ classifier = [
openssl = "0.10.32"
postgres = "0.19.0"
postgres-openssl = "0.5.0"
tikv-jemallocator = "0.5.0"
rand = "0.8.0"
serial_test = "0.5.1"
synapse_compress_state = { path = "../", features = ["no-progress-bars"] }
@@ -37,3 +36,11 @@ features = ["cargo"]
[dependencies.pyo3]
version = "0.16.4"
features = ["extension-module"]
[dependencies.tikv-jemallocator]
version = "0.5.0"
optional = true
[features]
default = ["jemalloc"]
jemalloc = ["tikv-jemallocator"]

View File

@@ -16,6 +16,7 @@
//! the state_compressor_state table so that the compressor can seemlesly
//! continue from where it left off.
#[cfg(feature = "jemalloc")]
#[global_allocator]
static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;