diff --git a/Cargo.toml b/Cargo.toml index 71970b41..4c182fa2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,9 @@ serde = { version = "1.0", features = ["derive"] } serde_cbor = "0.11.1" static_assertions = "1.1.0" +[target.'cfg(not(target_env = "msvc"))'.dependencies] +jemallocator = "0.3.2" + [dev-dependencies] criterion = "0.3.5" tynm = "0.1.6" diff --git a/src/lib.rs b/src/lib.rs index c72f783c..3ed9f747 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,3 +13,11 @@ pub mod iop; pub mod plonk; pub mod polynomial; pub mod util; + +// Set up Jemalloc +#[cfg(not(target_env = "msvc"))] +use jemallocator::Jemalloc; + +#[cfg(not(target_env = "msvc"))] +#[global_allocator] +static GLOBAL: Jemalloc = Jemalloc;