mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-17 08:34:19 +01:00
Make mimalloc dependency optional
This commit is contained in:
@@ -10,18 +10,19 @@ repository.workspace = true
|
||||
description = "Turso Rust API"
|
||||
|
||||
[features]
|
||||
default = ["experimental_indexes"]
|
||||
default = ["experimental_indexes", "mimalloc"]
|
||||
conn_raw_api = ["turso_core/conn_raw_api"]
|
||||
experimental_indexes = []
|
||||
antithesis = ["turso_core/antithesis"]
|
||||
tracing_release = ["turso_core/tracing_release"]
|
||||
mimalloc = ["dep:mimalloc"]
|
||||
|
||||
[dependencies]
|
||||
turso_core = { workspace = true, features = ["io_uring"] }
|
||||
thiserror = { workspace = true }
|
||||
tracing-subscriber.workspace = true
|
||||
tracing.workspace = true
|
||||
mimalloc = { workspace = true }
|
||||
mimalloc = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tempfile = { workspace = true }
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
//! # }
|
||||
//! ```
|
||||
|
||||
#[cfg(all(not(target_family = "wasm"), not(miri)))]
|
||||
#[cfg(all(feature = "mimalloc", not(target_family = "wasm"), not(miri)))]
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
|
||||
@@ -49,12 +49,13 @@ serde_json = "1.0"
|
||||
termimad = "0.30"
|
||||
include_dir = "0.7"
|
||||
rand = "0.8"
|
||||
mimalloc = { workspace = true }
|
||||
mimalloc = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
default = ["io_uring"]
|
||||
default = ["io_uring", "mimalloc"]
|
||||
io_uring = ["turso_core/io_uring"]
|
||||
tracing_release = ["turso_core/tracing_release"]
|
||||
mimalloc = ["dep:mimalloc"]
|
||||
|
||||
[build-dependencies]
|
||||
syntect = { git = "https://github.com/trishume/syntect.git", rev = "64644ffe064457265cbcee12a0c1baf9485ba6ee" }
|
||||
|
||||
@@ -16,7 +16,7 @@ use std::{
|
||||
sync::{atomic::Ordering, LazyLock},
|
||||
};
|
||||
|
||||
#[cfg(all(not(target_family = "wasm"), not(miri)))]
|
||||
#[cfg(all(feature = "mimalloc", not(target_family = "wasm"), not(miri)))]
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user