mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-16 02:11:20 +00:00
Add comments explaining the unsafe impls and simplify the code, too
This commit is contained in:
@ -474,6 +474,7 @@ pub struct ImportedFunc {
|
||||
pub vmctx: *mut Ctx,
|
||||
}
|
||||
|
||||
// manually implemented because ImportedFunc contains raw pointers directly; `Func` is marked Send (But `Ctx` actually isn't! (TODO: review this, shouldn't `Ctx` be Send?))
|
||||
unsafe impl Send for ImportedFunc {}
|
||||
|
||||
impl ImportedFunc {
|
||||
@ -503,6 +504,7 @@ pub struct LocalTable {
|
||||
pub table: *mut (),
|
||||
}
|
||||
|
||||
// manually implemented because LocalTable contains raw pointers directly
|
||||
unsafe impl Send for LocalTable {}
|
||||
|
||||
impl LocalTable {
|
||||
@ -534,6 +536,9 @@ pub struct LocalMemory {
|
||||
pub memory: *mut (),
|
||||
}
|
||||
|
||||
// manually implemented because LocalMemory contains raw pointers
|
||||
unsafe impl Send for LocalMemory {}
|
||||
|
||||
impl LocalMemory {
|
||||
#[allow(clippy::erasing_op)] // TODO
|
||||
pub fn offset_base() -> u8 {
|
||||
@ -584,6 +589,7 @@ pub struct Anyfunc {
|
||||
pub sig_id: SigId,
|
||||
}
|
||||
|
||||
// manually implemented because Anyfunc contains raw pointers directly
|
||||
unsafe impl Send for Anyfunc {}
|
||||
|
||||
impl Anyfunc {
|
||||
|
Reference in New Issue
Block a user