Skip to content

Commit 7f3f04a

Browse files
committed
Assert this isn't combined with multithreaded wasm (no locks are
present)
1 parent 1c88645 commit 7f3f04a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wasm.rs

+3
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,17 @@ unsafe impl Allocator for System {
5959
#[cfg(feature = "global")]
6060
pub fn acquire_global_lock() {
6161
// single threaded, no need!
62+
assert!(!cfg!(target_feature = "atomics"));
6263
}
6364

6465
#[cfg(feature = "global")]
6566
pub fn release_global_lock() {
6667
// single threaded, no need!
68+
assert!(!cfg!(target_feature = "atomics"));
6769
}
6870

6971
#[cfg(feature = "global")]
7072
pub unsafe fn enable_alloc_after_fork() {
7173
// single threaded, no need!
74+
assert!(!cfg!(target_feature = "atomics"));
7275
}

0 commit comments

Comments
 (0)