From bf76f6d8b6b00188869544f74d7e9cb897737714 Mon Sep 17 00:00:00 2001 From: Boshen Date: Sat, 25 Feb 2023 20:45:38 +0800 Subject: [PATCH] chore: ignore miri on global allocators error: unsupported operation: can't call foreign function `_rjem_malloc` on OS `linux` --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13 | 104 | ffi::malloc(layout.size()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't call foreign function `_rjem_malloc` on OS `linux` | = help: this is likely not a bug in the program; it indicates that the program performed an operation that the interpreter does not support = note: BACKTRACE: = note: inside `::alloc` at /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/jemallocator-0.5.0/src/lib.rs:104:13: 104:39 note: inside `_::__rg_alloc` --> tasks/benchmark/src/main.rs:13:16 | 12 | #[global_allocator] | ------------------- in this procedural macro expansion 13 | static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc; | ^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info) --- crates/oxc_cli/src/main.rs | 2 ++ tasks/benchmark/src/main.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/crates/oxc_cli/src/main.rs b/crates/oxc_cli/src/main.rs index 09f10edf4..3dfd0f2e8 100644 --- a/crates/oxc_cli/src/main.rs +++ b/crates/oxc_cli/src/main.rs @@ -1,7 +1,9 @@ +#[cfg_attr(miri, ignore)] #[cfg(not(target_env = "msvc"))] #[global_allocator] static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc; +#[cfg_attr(miri, ignore)] #[cfg(target_os = "windows")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; diff --git a/tasks/benchmark/src/main.rs b/tasks/benchmark/src/main.rs index 583d53db2..91c33cb12 100644 --- a/tasks/benchmark/src/main.rs +++ b/tasks/benchmark/src/main.rs @@ -8,10 +8,12 @@ use oxc_benchmark::get_code; use oxc_parser::Parser; use pico_args::Arguments; +#[cfg_attr(miri, ignore)] #[cfg(not(target_env = "msvc"))] #[global_allocator] static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc; +#[cfg_attr(miri, ignore)] #[cfg(target_os = "windows")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;