Update CodeMemory to be Send + Sync (#780)
* Update `CodeMemory` to be `Send + Sync` This commit updates the `CodeMemory` type in wasmtime to be both `Send` and `Sync` by updating the implementation of `Mmap` to not store raw pointers. This avoids the need for an `unsafe impl` and leaves the unsafety as it is currently. * Run rustfmt * Rename `offset` to `ptr`
This commit is contained in:
@@ -14,6 +14,11 @@ pub struct CodeMemory {
|
||||
published: usize,
|
||||
}
|
||||
|
||||
fn _assert() {
|
||||
fn _assert_send_sync<T: Send + Sync>() {}
|
||||
_assert_send_sync::<CodeMemory>();
|
||||
}
|
||||
|
||||
impl CodeMemory {
|
||||
/// Create a new `CodeMemory` instance.
|
||||
pub fn new() -> Self {
|
||||
|
||||
Reference in New Issue
Block a user