Skip to content

Commit

Permalink
Throw compilation error if AtomicUsize is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
jedel1043 committed Oct 19, 2023
1 parent 1533383 commit a9e0c76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions boa_engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
clippy::missing_panics_doc,
)]

#[cfg(not(target_has_atomic = "ptr"))]
compile_error!("Boa requires a lock free `AtomicUsize` in order to work properly.");

extern crate static_assertions as sa;

pub mod bigint;
Expand Down
7 changes: 4 additions & 3 deletions boa_engine/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ use num_enum::{IntoPrimitive, TryFromPrimitive};

use std::{
hash::{Hash, Hasher},
sync::{atomic::Ordering, Arc},
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
};

use portable_atomic::AtomicUsize;

/// Reserved number of symbols.
///
/// This is where the well known symbol live
Expand Down

0 comments on commit a9e0c76

Please sign in to comment.