Which platforms support atomic operations on usize?

Hi there quick question, how do I know if a platform supports atomic operations on usize?

edit: bad hack removed the cfg() is way better :slight_smile:

It looks like atomic usize operations are available on any platform where #[cfg(target_has_atomic_load_store = "ptr")] is set.

The code that sets this cfg attribute is here.

1 Like

Note that it's guaranteed if the AtomicUsize type exist.

This type has the same in-memory representation as the underlying integer type


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.