Skip to content

Add support for targets without atomic operations #383

@zeegomo

Description

@zeegomo

This crate cannot currently be built for targets that do not support atomic operations (e.g. riscv32im) due to LazyBool/Usize in

pub struct LazyUsize(AtomicUsize);
, even though those are not used when providing a custom implementation.

Example error when compiling for riscv32im

error[E0432]: unresolved import `core::sync::atomic::AtomicUsize`
  --> src/util.rs:12:20
   |
12 |     sync::atomic::{AtomicUsize, Ordering::Relaxed},
   |                    ^^^^^^^^^^^ no `AtomicUsize` in `sync::atomic`

It would be nice to have this working there as well, a quick workaround could be to conditionally compile those additional structs only when atomics are available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions