aports/testing/rollup/no-mimalloc.patch.noauto
2026-01-23 00:38:35 +01:00

51 lines
2.0 KiB
Plaintext

From 9b0c58cc61e0f88b5d4cabe09c02889167f5e300 Mon Sep 17 00:00:00 2001
From: LN Liberda <lauren@selfisekai.rocks>
Date: Thu, 22 Jan 2026 15:24:27 +0100
Subject: [PATCH] Don't use mimalloc
It's vendored only
---
rust/bindings_napi/Cargo.toml | 2 --
rust/bindings_napi/src/lib.rs | 10 ----------
2 files changed, 12 deletions(-)
diff --git a/rust/bindings_napi/Cargo.toml b/rust/bindings_napi/Cargo.toml
index 44bb221c9..a85b81ff6 100644
--- a/rust/bindings_napi/Cargo.toml
+++ b/rust/bindings_napi/Cargo.toml
@@ -34,13 +34,11 @@ mimalloc-safe = { version = "0.1.56" }
# )
# )
[target.'cfg(any(all(target_os = "linux", not(target_arch = "loongarch64"), not(all(target_arch = "riscv64", target_env = "musl")), not(target_env = "ohos")), all(target_os = "freebsd", not(target_arch = "aarch64"))))'.dependencies]
-mimalloc-safe = { version = "0.1.56", features = ["local_dynamic_tls"] }
# Disable architecture specific optimizations on aarch64 platforms
# Mimalloc assumes `armv8.1-a` is supported, which is not always the case
# Ref: https://github.com/rollup/rollup/issues/6047
[target.'cfg(all(target_arch = "aarch64", not(target_vendor = "apple")))'.dependencies]
-mimalloc-safe = { version = "0.1.56", features = ["no_opt_arch"] }
[build-dependencies]
napi-build = "2.3.1"
diff --git a/rust/bindings_napi/src/lib.rs b/rust/bindings_napi/src/lib.rs
index 101411df0..92aedff76 100644
--- a/rust/bindings_napi/src/lib.rs
+++ b/rust/bindings_napi/src/lib.rs
@@ -2,16 +2,6 @@ use napi::{bindgen_prelude::*, ScopedTask};
use napi_derive::napi;
use parse_ast::parse_ast;
-#[cfg(all(
- not(all(target_os = "linux", target_arch = "loongarch64")),
- not(all(target_os = "linux", target_arch = "riscv64", target_env = "musl")),
- not(all(target_os = "linux", target_env = "ohos")),
- not(all(target_os = "freebsd", target_arch = "aarch64")),
- not(debug_assertions)
-))]
-#[global_allocator]
-static ALLOC: mimalloc_safe::MiMalloc = mimalloc_safe::MiMalloc;
-
pub struct ParseTask {
pub code: String,
pub allow_return_outside_function: bool,