Skip to content

Commit 66014fa

Browse files
committed
chore(deno-lint): migrate to mimalloc_rust
1 parent fa9c437 commit 66014fa

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

packages/deno-lint/Cargo.toml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
authors = ["LongYinan <[email protected]>"]
3-
edition = "2018"
3+
edition = "2021"
44
name = "deno-lint"
55
version = "0.1.0"
66

@@ -13,15 +13,13 @@ anyhow = "1"
1313
deno_ast = "0.4.1"
1414
deno_lint = "0.18.1"
1515
env_logger = "0.9"
16+
global_alloc = {path = "../../crates/alloc"}
1617
globwalk = "0.8"
1718
ignore = "0.4"
1819
napi = {version = "1", features = ["serde-json"]}
1920
napi-derive = "1"
2021
serde = "1"
2122
serde_json = "1"
2223

23-
[target.'cfg(all(target_arch = "x86_64", not(target_env = "musl")))'.dependencies]
24-
mimalloc = {version = "0.1"}
25-
2624
[build-dependencies]
27-
napi-build = "1.1.0"
25+
napi-build = "1"

packages/deno-lint/src/lib.rs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![deny(clippy::all)]
22
#![allow(clippy::nonstandard_macro_braces)]
33

4-
#[macro_use]
5-
extern crate napi_derive;
4+
/// Explicit extern crate to use allocator.
5+
extern crate global_alloc;
66

77
use std::env;
88
use std::fs;
@@ -16,18 +16,11 @@ use deno_lint::rules::{get_all_rules, get_recommended_rules};
1616
use ignore::types::TypesBuilder;
1717
use ignore::WalkBuilder;
1818
use napi::{CallContext, Error, JsBoolean, JsBuffer, JsObject, JsString, Result, Status};
19+
use napi_derive::*;
1920

2021
mod config;
2122
mod diagnostics;
2223

23-
#[cfg(all(
24-
target_arch = "x86_64",
25-
not(target_env = "musl"),
26-
not(debug_assertions)
27-
))]
28-
#[global_allocator]
29-
static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc;
30-
3124
#[module_exports]
3225
fn init(mut exports: JsObject) -> Result<()> {
3326
env_logger::init();

0 commit comments

Comments
 (0)