mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 13:11:32 +00:00
clean up implementation
This commit is contained in:
@ -5,9 +5,10 @@ use crate::{
|
||||
structures::TypedIndex,
|
||||
types::{LocalOrImport, MemoryIndex},
|
||||
};
|
||||
use hashbrown::HashMap;
|
||||
use std::{ffi::c_void, mem, ptr};
|
||||
|
||||
use hashbrown::HashMap;
|
||||
|
||||
/// The context of the currently running WebAssembly instance.
|
||||
///
|
||||
///
|
||||
@ -25,8 +26,6 @@ pub struct Ctx {
|
||||
|
||||
pub data: *mut c_void,
|
||||
pub data_finalizer: Option<extern "C" fn(data: *mut c_void)>,
|
||||
|
||||
pub maybe_symbol_map: Option<HashMap<u32, String>>,
|
||||
}
|
||||
|
||||
/// The internal context of the currently running WebAssembly instance.
|
||||
@ -70,7 +69,6 @@ impl Ctx {
|
||||
local_backing: &mut LocalBacking,
|
||||
import_backing: &mut ImportBacking,
|
||||
module: &ModuleInner,
|
||||
maybe_symbol_map: Option<HashMap<u32, String>>,
|
||||
) -> Self {
|
||||
Self {
|
||||
internal: InternalCtx {
|
||||
@ -93,7 +91,6 @@ impl Ctx {
|
||||
|
||||
data: ptr::null_mut(),
|
||||
data_finalizer: None,
|
||||
maybe_symbol_map,
|
||||
}
|
||||
}
|
||||
|
||||
@ -126,7 +123,6 @@ impl Ctx {
|
||||
|
||||
data,
|
||||
data_finalizer: Some(data_finalizer),
|
||||
maybe_symbol_map: None,
|
||||
}
|
||||
}
|
||||
|
||||
@ -162,6 +158,10 @@ impl Ctx {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe fn borrow_symbol_map(&self) -> &Option<HashMap<u32, String>> {
|
||||
&(*self.module).info.em_symbol_map
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
|
Reference in New Issue
Block a user