diff --git a/Cargo.lock b/Cargo.lock index 5f90920d..42d37d1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,9 +180,9 @@ checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" [[package]] name = "anymap" -version = "0.12.1" +version = "1.0.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" +checksum = "8f1f8f5a6f3d50d89e3797d7593a50f96bb2aaa20ca0cc7be1fb673232c91d72" [[package]] name = "approx" diff --git a/Cargo.toml b/Cargo.toml index 63c0252d..7b58aa28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ docs = [] nih_plug_derive = { path = "nih_plug_derive" } anyhow = "1.0" -anymap = "0.12.1" +anymap = "1.0.0-beta.2" atomic_float = "0.1" atomic_refcell = "0.1" backtrace = "0.3.65" diff --git a/src/event_loop/background_thread.rs b/src/event_loop/background_thread.rs index 90ee3d8c..b41d34ac 100644 --- a/src/event_loop/background_thread.rs +++ b/src/event_loop/background_thread.rs @@ -77,7 +77,7 @@ where // workaround to have a singleton that also works if for whatever reason there arem ultiple `T` // and `E`s in a single process (won't happen with normal plugin usage, but sho knwos). lazy_static::lazy_static! { - static ref HANDLE_MAP: Mutex> = + static ref HANDLE_MAP: Mutex> = Mutex::new(anymap::Map::new()); } diff --git a/src/wrapper/clap.rs b/src/wrapper/clap.rs index eb83294c..b6d4bde0 100644 --- a/src/wrapper/clap.rs +++ b/src/wrapper/clap.rs @@ -44,7 +44,7 @@ macro_rules! nih_export_clap { && unsafe { ::std::ffi::CStr::from_ptr(factory_id) } == ::nih_plug::wrapper::clap::CLAP_PLUGIN_FACTORY_ID { - &(*FACTORY).clap_plugin_factory as *const _ as *const ::std::ffi::c_void + &*FACTORY as *const _ as *const ::std::ffi::c_void } else { std::ptr::null() } diff --git a/src/wrapper/util.rs b/src/wrapper/util.rs index 13a0d7c1..a70b92f6 100644 --- a/src/wrapper/util.rs +++ b/src/wrapper/util.rs @@ -204,7 +204,7 @@ struct ScopedFtz { impl ScopedFtz { fn enable() -> Self { cfg_if::cfg_if! { - if #[cfg(target_feature = "sse")] { + if #[cfg(all(target_feature = "sse", not(miri)))] { let mode = unsafe { std::arch::x86_64::_MM_GET_FLUSH_ZERO_MODE() }; let should_disable_again = mode != std::arch::x86_64::_MM_FLUSH_ZERO_ON; if should_disable_again { @@ -215,7 +215,7 @@ impl ScopedFtz { should_disable_again, _send_sync_marker: PhantomData, } - } else if #[cfg(target_arch = "aarch64")] { + } else if #[cfg(all(target_arch = "aarch64", not(miri)))] { // There are no convient intrinsics to change the FTZ settings on AArch64, so this // requires inline assembly: // https://developer.arm.com/documentation/ddi0595/2021-06/AArch64-Registers/FPCR--Floating-point-Control-Register @@ -243,6 +243,7 @@ impl ScopedFtz { impl Drop for ScopedFtz { fn drop(&mut self) { + #[cfg(not(miri))] if self.should_disable_again { cfg_if::cfg_if! { if #[cfg(target_feature = "sse")] {