Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for mutable Global in HostModuleBuilder #2332

Open
redexp opened this issue Oct 25, 2024 · 0 comments
Open

Support for mutable Global in HostModuleBuilder #2332

redexp opened this issue Oct 25, 2024 · 0 comments

Comments

@redexp
Copy link

redexp commented Oct 25, 2024

Good day

I have wasm file (compiled with emscripten) that instantiated with js code and I'm trying to do same thing with wazero and I'm stuck on part with new WebAssembly.Global(...)

WebAssembly.instantiateStreaming(source, {
  //...
  env: {
    __stack_pointer: new WebAssembly.Global({
          "value": "i32",
          "mutable": true
    }, 78112),
    _emscripten_get_now_is_monotonic: () => 1,
  },
})

I do not have problems with functions like _emscripten_get_now_is_monotonic I can add them like this

env.NewFunctionBuilder().
	WithFunc(func() int32 { return 1 }).
	Export("_emscripten_get_now_is_monotonic")

but how to add Global instead of function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant