git.delta.rocks / jrsonnet / refs/commits / 8c5f44d1f49f

difftreelog

feat make mimalloc optional

Лач2020-07-22parent: #e4a890b.patch.diff
in: master

2 files changed

modifiedcmds/jrsonnet/Cargo.tomldiffbeforeafterboth
before · cmds/jrsonnet/Cargo.toml
1[package]2name = "jrsonnet"3description = "Rust jsonnet implementation"4version = "1.0.0"5authors = ["Лач <iam@lach.pw>"]6license = "MIT"7edition = "2018"89# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html1011[dependencies]12jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "1.0.0" }13jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "1.0.0" }14jrsonnet-cli = { path = "../../crates/jrsonnet-cli", version = "0.1.0" }15# TODO: Fix mimalloc compile errors, and use them16mimallocator = "0.1.3"1718[dependencies.clap]19git = "https://github.com/clap-rs/clap"20rev = "48d308a8ab9e96d4b21336e428feee420dbac51d"
after · cmds/jrsonnet/Cargo.toml
1[package]2name = "jrsonnet"3description = "Rust jsonnet implementation"4version = "1.0.0"5authors = ["Лач <iam@lach.pw>"]6license = "MIT"7edition = "2018"89# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html1011[features]12default = []13# Use mimalloc as allocator14mimalloc = []1516[dependencies]17jrsonnet-evaluator = { path = "../../crates/jrsonnet-evaluator", version = "1.0.0" }18jrsonnet-parser = { path = "../../crates/jrsonnet-parser", version = "1.0.0" }19jrsonnet-cli = { path = "../../crates/jrsonnet-cli", version = "0.1.0" }20# TODO: Fix mimalloc compile errors, and use them21mimallocator = { version = "0.1.3", optional = true }2223[dependencies.clap]24git = "https://github.com/clap-rs/clap"25rev = "48d308a8ab9e96d4b21336e428feee420dbac51d"
modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
--- a/cmds/jrsonnet/src/main.rs
+++ b/cmds/jrsonnet/src/main.rs
@@ -3,6 +3,7 @@
 use jrsonnet_evaluator::{error::Result, EvaluationState};
 use std::{path::PathBuf, rc::Rc};
 
+#[cfg(feature = "mimalloc")]
 #[global_allocator]
 static GLOBAL: mimallocator::Mimalloc = mimallocator::Mimalloc;