Skip to content

Commit 1b1f9db

Browse files
committed
stop special-casing futex creation on macOS
1 parent 44b8baf commit 1b1f9db

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/shims/unix/macos/sync.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
143143
.read_scalar_atomic(&this.ptr_to_mplace(ptr, layout), AtomicReadOrd::Acquire)?
144144
.to_bits(Size::from_bytes(size))?;
145145

146-
let Some(futex) = this.get_sync_or_init(ptr, |_| {
147-
MacOsFutex {
148-
futex: Default::default(),
149-
size: Cell::new(size),
150-
shared: Cell::new(is_shared),
151-
}
152-
}) else {
153-
this.set_last_error_and_return(LibcError("ENOMEM"), dest)?;
154-
return interp_ok(());
155-
};
146+
let futex = this
147+
.get_sync_or_init(ptr, |_| {
148+
MacOsFutex {
149+
futex: Default::default(),
150+
size: Cell::new(size),
151+
shared: Cell::new(is_shared),
152+
}
153+
})
154+
.unwrap();
156155

157156
// Detect mismatches between the flags and sizes used on this address
158157
// by comparing with the parameters stored with the first waiter.

0 commit comments

Comments
 (0)