mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-30 23:02:06 +00:00
Update emscripten to latest changes
This commit is contained in:
@@ -32,7 +32,7 @@ impl FuncResolver for PlaceholderFuncResolver {
|
||||
|
||||
/// This contains all of the items in a `ModuleInner` except the `func_resolver`.
|
||||
pub struct Module {
|
||||
module: ModuleInner,
|
||||
pub module: ModuleInner,
|
||||
}
|
||||
|
||||
impl Module {
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -6,14 +6,16 @@ use std::ffi::CStr;
|
||||
use std::mem::size_of;
|
||||
use std::os::raw::c_char;
|
||||
use std::slice;
|
||||
use std::sync::Arc;
|
||||
/// We check if a provided module is an Emscripten generated one
|
||||
pub fn is_emscripten_module(module: &Module) -> bool {
|
||||
for (_, import_name) in &module.imported_functions {
|
||||
if import_name.name == "_emscripten_memcpy_big" && import_name.namespace == "env" {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
pub fn is_emscripten_module(module: &Arc<Module>) -> bool {
|
||||
// for (_, import_name) in &module.imported_functions {
|
||||
// if import_name.name == "_emscripten_memcpy_big" && import_name.namespace == "env" {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// false
|
||||
true
|
||||
}
|
||||
|
||||
pub unsafe fn write_to_buf(string: *const c_char, buf: u32, max: u32, instance: &Instance) -> u32 {
|
||||
|
@@ -24,7 +24,7 @@ pub(crate) struct InstanceInner {
|
||||
}
|
||||
|
||||
pub struct Instance {
|
||||
pub(crate) module: Rc<ModuleInner>,
|
||||
pub module: Rc<ModuleInner>,
|
||||
inner: Box<InstanceInner>,
|
||||
#[allow(dead_code)]
|
||||
imports: Box<Imports>,
|
||||
|
@@ -3,7 +3,7 @@
|
||||
extern crate field_offset;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
pub mod macros;
|
||||
#[doc(hidden)]
|
||||
pub mod backend;
|
||||
mod backing;
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#[macro_export]
|
||||
macro_rules! debug {
|
||||
($fmt:expr) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt), line!()) });
|
||||
($fmt:expr, $($arg:tt)*) => (if cfg!(any(debug_assertions, feature="debug")) { println!(concat!("wasmer-runtime(:{})::", $fmt, "\n"), line!(), $($arg)*) });
|
||||
|
@@ -39,7 +39,7 @@ pub struct ModuleInner {
|
||||
pub sig_registry: SigRegistry,
|
||||
}
|
||||
|
||||
pub struct Module(Rc<ModuleInner>);
|
||||
pub struct Module(pub Rc<ModuleInner>);
|
||||
|
||||
impl Module {
|
||||
pub(crate) fn new(inner: Rc<ModuleInner>) -> Self {
|
||||
|
Reference in New Issue
Block a user