Support cfg(target_arch = "wasm32", target_feature = "atomic")
#8
Labels
enhancement
New feature or request
cfg(target_arch = "wasm32", target_feature = "atomic")
#8
rlsf::GlobalTlsf
(std::alloc::GlobalAlloc
implementation) requires target-specific code to synchronize concurrent function calls. The code forcfg(target_arch = "wasm32", target_feature = "atomic")
was left out as its support (rust-lang/rust#77839) in Rust was still in infancy.rlsf/crates/rlsf/src/global/wasm32.rs
Lines 12 to 20 in e315d64
Now that WASM atomic intrinsics have been introduced to
core
(still unstable though), it's possible to implement this now, but we must decide which mutex implementation to use:std::sync::Mutex
Flag +
memory_atomic_{wait32,notify}
Ticket lock +
memory_atomic_{wait32,notify}
Queue-based lock (e.g., MCS, CLH) +
memory_atomic_{wait32,notify}
Flag + busy loop (spinlock)
Ticket lock + busy loop
The text was updated successfully, but these errors were encountered: