Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions napi/minify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ napi = { workspace = true }
napi-derive = { workspace = true }

[target.'cfg(all(not(target_os = "linux"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_family = "wasm")))'.dependencies]
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit"] }
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit"], optional = true }

[target.'cfg(any(all(target_os = "linux", not(target_arch = "arm")), target_os = "freebsd"))'.dependencies]
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit", "local_dynamic_tls"] }
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit", "local_dynamic_tls"], optional = true }

[build-dependencies]
napi-build = { workspace = true }

[features]
default = []
allocator = ["dep:mimalloc-safe"]
2 changes: 1 addition & 1 deletion napi/minify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"browser": "browser.js",
"scripts": {
"build-dev": "napi build --no-dts-cache --platform",
"build": "pnpm run build-dev --release",
"build": "pnpm run build-dev --features allocator --release",
"test": "vitest run --dir ./test && tsc"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion napi/minify/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![expect(clippy::needless_pass_by_value, clippy::missing_errors_doc)]

#[cfg(all(not(target_arch = "arm"), not(target_family = "wasm")))]
#[cfg(all(feature = "allocator", not(target_arch = "arm"), not(target_family = "wasm")))]
#[global_allocator]
static ALLOC: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

Expand Down
8 changes: 6 additions & 2 deletions napi/parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ napi = { workspace = true, features = ["async"] }
napi-derive = { workspace = true }

[target.'cfg(all(not(target_os = "linux"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_family = "wasm")))'.dependencies]
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit"] }
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit"], optional = true }

[target.'cfg(any(all(target_os = "linux", not(target_arch = "arm")), target_os = "freebsd"))'.dependencies]
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit", "local_dynamic_tls"] }
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit", "local_dynamic_tls"], optional = true }

[build-dependencies]
napi-build = { workspace = true }

[features]
default = []
allocator = ["dep:mimalloc-safe"]
2 changes: 1 addition & 1 deletion napi/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"browser": "wasm.mjs",
"scripts": {
"build-dev": "napi build --no-dts-cache --platform --js bindings.js",
"build": "pnpm run build-dev --release",
"build": "pnpm run build-dev --features allocator --release",
"build-wasi": "pnpm run build-dev --release --target wasm32-wasip1-threads",
"build-npm-dir": "rm -rf npm-dir && napi create-npm-dirs --npm-dir npm-dir && pnpm napi artifacts --npm-dir npm-dir --output-dir .",
"test": "pnpm run test-node run && tsc",
Expand Down
2 changes: 1 addition & 1 deletion napi/parser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Napi value need to be passed as value
#![expect(clippy::needless_pass_by_value)]

#[cfg(all(not(target_arch = "arm"), not(target_family = "wasm")))]
#[cfg(all(feature = "allocator", not(target_arch = "arm"), not(target_family = "wasm")))]
#[global_allocator]
static ALLOC: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

Expand Down
8 changes: 6 additions & 2 deletions napi/transform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ napi = { workspace = true }
napi-derive = { workspace = true }

[target.'cfg(all(not(target_os = "linux"), not(target_os = "freebsd"), not(target_arch = "arm"), not(target_family = "wasm")))'.dependencies]
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit"] }
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit"], optional = true }

[target.'cfg(any(all(target_os = "linux", not(target_arch = "arm")), target_os = "freebsd"))'.dependencies]
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit", "local_dynamic_tls"] }
mimalloc-safe = { workspace = true, features = ["skip_collect_on_exit", "local_dynamic_tls"], optional = true }

[build-dependencies]
napi-build = { workspace = true }

[features]
default = []
allocator = ["dep:mimalloc-safe"]
2 changes: 1 addition & 1 deletion napi/transform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"browser": "browser.js",
"scripts": {
"build-dev": "napi --no-dts-cache build --platform",
"build": "pnpm run build-dev --release",
"build": "pnpm run build-dev --features allocator --release",
"test": "vitest run --dir ./test && tsc"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion napi/transform/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#[cfg(all(not(target_arch = "arm"), not(target_family = "wasm")))]
#[cfg(all(feature = "allocator", not(target_arch = "arm"), not(target_family = "wasm")))]
#[global_allocator]
static ALLOC: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;

Expand Down
Loading