diff --git a/Cargo.lock b/Cargo.lock index 4583e4553..e44b703e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4838,6 +4838,7 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" name = "turso" version = "0.3.0-pre.4" dependencies = [ + "mimalloc", "rand 0.9.2", "rand_chacha 0.9.0", "tempfile", diff --git a/bindings/rust/Cargo.toml b/bindings/rust/Cargo.toml index 42bce00cd..fec34f698 100644 --- a/bindings/rust/Cargo.toml +++ b/bindings/rust/Cargo.toml @@ -21,6 +21,7 @@ turso_core = { workspace = true, features = ["io_uring"] } thiserror = { workspace = true } tracing-subscriber.workspace = true tracing.workspace = true +mimalloc = { workspace = true } [dev-dependencies] tempfile = { workspace = true } diff --git a/bindings/rust/src/lib.rs b/bindings/rust/src/lib.rs index 8cd47d599..27a51dea1 100644 --- a/bindings/rust/src/lib.rs +++ b/bindings/rust/src/lib.rs @@ -32,6 +32,10 @@ //! # } //! ``` +#[cfg(all(not(target_family = "wasm"), not(miri)))] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + pub mod params; mod rows; pub mod transaction;