* Fix Wait/Notify opcode, the waiters hashmap is now on the Memory itself
* Refactored for clarity
* Use WAIT_ERROR everywhere
* Change from WAIT_ERROR to Option
* Added some unit test for threadconditions
* Switch from `Mutex<HashMap<...>>` to `DashMap<...>` for the NotifyMap
* Use FnvHasher for Dashmap
* Change timeout value in unit test to leave more margin to the system to react.
* Consolidate code, avoid duplication
* Put test in a test module
* Use an Result with custom error instead of an option for waiter
Revert the FD backed mmap implementation to the previous plain memory
functionality.
This preserves current performance characteristics for users.
Wasix will use a custom memory implementation which uses FD backing.
Also adds a duplicate() method.
The StoreSnapshot isn't necessary in the public API.
Thanks to the new global accessors on StoreObjects, it is possible to
implement this externally instead.
Musl libc does not have a libc::copy_file_range.
Since apple does not have it either, we factor out the implementation
into a separate function.
This also fixes up the copy code so it actually works correctly...
This commit extracts changes to core libraries made in the WASIX branch.
It is not reasonable to extract the partial commit history, so this is
just a batch commit.
The history will make a bit more sense again if we decide to merge the
WASIX branch with full commit history.
- Update `traphandlers.rs` to use the same `pc`/`sp` values for amd64 as
are used for x86
- Ensure amd64 is treated the same as x86_64 in the Makefile
- Add an `IS_FREEBSD` variable to the Makefile which is pretty much the
same as `IS_DARWIN`
- Update CHANGELOG.md
wasmer partially works on FreeBSD/amd64 with these few tiny changes.
However, after printing the output of cowsay.wasm, it hangs for a long
time (55 seconds in this example).
Using rust toolchain `1.63-x86_64-apple-darwin` (correct behavior):
```
% time ./target/release/wasmer cowsay.wasm -- hello world
_____________
< hello world >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
./target/release/wasmer cowsay.wasm -- hello world 0.01s user 0.01s system 41% cpu 0.061 total
```
Using rust toolchain `1.63-x86_64-unknown-freebsd` (incorrect behavior):
```
% time ./target/release/wasmer cowsay.wasm -- hello world
_____________
< hello world >
-------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
./target/release/wasmer cowsay.wasm -- hello world 55.14s user 0.05s system 100% cpu 55.183 total
```
cowsay.wasm is https://registry-cdn.wapm.io/contents/syrusakbary/cowsay/0.2.0/target/wasm32-wasi/release/cowsay.wasm
Removed public Imports::import_shared_memory and try to auto-initialize shared memory directly
Fixed clippy
Added Atomic Add/Sub/And/Or/Xor operator to Singlepass/AArch64 backend
Added atomic_xchg support for Singlepass/AArch64 backend
Finished all atomic access operator for Singlepass/Aarch64 backend