about summary refs log tree commit diff
path: root/library/std/src/sys/wasm
AgeCommit message (Collapse)AuthorLines
2021-01-29sys: use `process::abort()` instead of `arch::wasm32::unreachable()`Miguel Ojeda-1/+1
Rationale: - `abort()` lowers to `wasm32::unreachable()` anyway. - `abort()` isn't `unsafe`. - `abort()` matches the comment better. - `abort()` avoids confusion by future readers (e.g. https://github.com/rust-lang/rust/pull/81527): the naming of wasm's `unreachable' instruction is a bit unfortunate because it is not related to the `unreachable()` intrinsic (intended to trigger UB). Codegen is likely to be different since `unreachable()` is `inline` while `abort()` is `cold`. Since it doesn't look like we are expecting here to trigger this case, the latter seems better anyway. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2020-11-17Rollup merge of #78138 - fortanix:raoul/dlmalloc0.2, r=Mark-SimulacrumMara Bos-1/+1
Upgrade dlmalloc to version 0.2 In preparation of adding dynamic memory management support for SGXv2-enabled platforms, the dlmalloc crate has been refactored. More specifically, support has been added to implement platform specification outside of the dlmalloc crate. (see https://github.com/alexcrichton/dlmalloc-rs/pull/15) This PR upgrades dlmalloc to version 0.2 for the `wasm` and `sgx` targets. As the dlmalloc changes have received a positive review, but have not been merged yet, this PR contains a commit to prevent tidy from aborting CI prematurely. cc: `@jethrogb`
2020-11-12Upgrading dlmalloc to 0.2.1Raoul Strackx-1/+1
2020-11-12Fix an intrinsic invocation on threaded wasmAlex Crichton-1/+1
This looks like it was forgotten to get updated in #74482 and wasm with threads isn't built on CI so we didn't catch this by accident.
2020-10-24Remove unnecessary unsafe block from condvar_atomics & mutex_atomicschansuke-3/+3
2020-10-24Fix unsafe operation of wasm32::memory_atomic_notifychansuke-1/+2
2020-10-24Add documents for DLMALLOCchansuke-4/+8
2020-10-24Add some description for (malloc/calloc/free/realloc)chansuke-0/+4
2020-10-24`#[deny(unsafe_op_in_unsafe_fn)]` in sys/wasmchansuke-18/+32
2020-10-16Rollup merge of #77619 - fusion-engineering-forks:wasm-parker, r=dtolnayDylan DPC-0/+19
Use futex-based thread-parker for Wasm32. This uses the existing `sys_common/thread_parker/futex.rs` futex-based thread parker (that was already used for Linux) for wasm32 as well (if the wasm32 atomics target feature is enabled, which is not the case by default). Wasm32 provides the basic futex operations as instructions: https://webassembly.github.io/threads/syntax/instructions.html These are now exposed from `sys::futex::{futex_wait, futex_wake}`, just like on Linux. So, `thread_parker/futex.rs` stays completely unmodified.
2020-10-13Deny unsafe_op_in_unsafe_fn for unsupported/common.rs through sys/wasm too.Mara Bos-0/+1
2020-10-06Use futex-based thread-parker for Wasm32.Mara Bos-0/+19
2020-10-02No longer put wasm condvars in a box.Mara Bos-1/+1
These condvars are just an AtomicUsize, so can be moved without problems.
2020-10-02Make it possible to have unboxed condvars on specific platforms.Mara Bos-0/+2
This commit keeps all condvars boxed on all platforms, but makes it trivial to remove the box on some platforms later.
2020-10-02No longer put wasm mutexes in a box.Mara Bos-1/+1
These mutexes are just an AtomicUsize, so can be moved without problems.
2020-10-02Make it possible to have unboxed mutexes on specific platforms.Mara Bos-0/+2
This commit keeps all mutexes boxed on all platforms, but makes it trivial to remove the box on some platforms later.
2020-09-15Consolidate byte-identical modules.Eric Huss-1/+1
2020-07-28Update stdarch submoduleAlex Crichton-9/+9
This commit updates the src/stdarch submodule primarily to include rust-lang/stdarch#874 which updated and revamped WebAssembly SIMD intrinsics and renamed WebAssembly atomics intrinsics. This is all unstable surface area of the standard library so the changes should be ok here. The SIMD updates also enable SIMD intrinsics to be used by any program any any time, yay! cc #74372, a tracking issue I've opened for the stabilization of SIMD intrinsics
2020-07-27mv std libs to library/mark-0/+766