diff --git a/Cargo.toml b/Cargo.toml index a704177..5557037 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ name = "libipld" crate-type = ["rlib", "cdylib"] [dependencies] +mimalloc = { version = "*" } pyo3 = { version = "0.27.1", features = ["generate-import-lib", "anyhow"] } python3-dll-a = "0.2.14" anyhow = "1.0.100" diff --git a/src/lib.rs b/src/lib.rs index 0434a64..bcb4e48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,8 @@ +use mimalloc::MiMalloc; + +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; + use std::io::{self, Cursor, Write}; use anyhow::{anyhow, Result};