wasmer/lib/runtime-core
bors[bot] 8c5ccdb497
Merge #807
807: Implement Send for Instance r=MarkMcCaskey a=MarkMcCaskey

# Review

- [x] Create a short description of the the change in the CHANGELOG.md file

Resolves #748 

WIP

## List of changes
### Commit 1
- `Global`s use Arc instead of RC
- Export `Context` and `FuncPointer` manually implement Send
- `ImportObject` uses `Arc<Mutex<HashMap<...>>>` Instead of `Rc<RefCell<HashMap<...>>>`; removed `get_namespace` method in favor of continuation style to deal with locking the Mutex
- `Func` manually implements `Send` (TODO: this change needs to be checked in depth)
### Commit 2
- `unsafe impl Send for Export {}` (temporary to allow Memory to be not Send)
- RefCell -> Mutex in Global and Table
- Rc -> Arc in Table
- Namespace's `IsExport`s must be `Send` (Done to avoid touching much more of the code (i.e. `trait IsExport: Send` requires a lot -- maybe this is what we should do though)
- Make `Host` and `Wasm` `Func`s Send (manual implementation)
- Manual implementation for `LocalTable` and `AnyFunc`
### Commit 3
- rm placeholder `unsafe impl Send for Export {}`
- Manual implementation for `LocalBacking` and `ImportBacking` (both seemed to be not Send due to direct ownership of mutable pointers in their containers)
- ImportObject's state creator Fn trait object is now ` + Send + Sync + 'static` (required because it's in an Arc)
- Manually implement Send for `InstanceInner` because it holds a raw pointer, `LocalBacking` and `ImportBacking` are marked Send separately 
- Memory: All Rc -> Arc (including unshared memory); All RefCell -> Mutex (including unshared memory)
- Manual implementation of Send and Sync on `UnsharedMemoryInternal`
- Manual implementation of Send and Sync on `SharedMemoryInternal`
- Change `runtime-core::unix::memory::Memory.fd` from `Option<Rc<Rawfd>>` to `Option<Arc<Rawfd>>` (not strictly required for this change because Memory has manual implementations of Send and Sync, but Arc seems more correct here and there's no comment justifying the use of Rc)
- Manual implementation of Send for `ImportedFunc`

Co-authored-by: Mark McCaskey <mark@wasmer.io>
Co-authored-by: Mark McCaskey <markmccaskey@users.noreply.github.com>
2019-09-23 21:20:01 +00:00
..
src Merge #807 2019-09-23 21:20:01 +00:00
build.rs Improved docs with custom logo and favicon 2019-09-03 17:06:31 -07:00
Cargo.toml Remove patch version in deps when not necessary 2019-09-20 16:11:09 -07:00
image-loading-linux-x86-64.s Fix issues with testing/linking singlepass in runtime-c-api 2019-09-19 00:19:17 +02:00
image-loading-macos-x86-64.s register_preservation_trampoline 2019-08-15 19:08:11 -07:00
README.md doc(lib) Add basic README.md. 2019-03-29 10:17:24 +01:00

Wasmer logo

Build Status License Join the Wasmer Community Number of downloads from crates.io Read our API documentation

Wasmer Runtime Core

Wasmer is a standalone JIT WebAssembly runtime, aiming to be fully compatible with Emscripten, Rust and Go. Learn more.

This crate represents the core of the runtime.