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

Memory object #9

Closed
Faliszek opened this issue May 2, 2023 · 3 comments
Closed

Memory object #9

Faliszek opened this issue May 2, 2023 · 3 comments

Comments

@Faliszek
Copy link

Faliszek commented May 2, 2023

First of all - thank you so much for your work on this, amazing job!

I try to use it in order to load some wasm file generated from this repo: https://github.com/matrix-org/matrix-rust-sdk/tree/main/bindings/matrix-sdk-crypto-js

It loads perfectly fine, but later this library uses memory object which from what I read, in browser returns from instatiate function (I think)

When I compile their wasm file to wat there is a code that looks like this

(memory $memory (export "memory") 20)

which according to chatgpt should be accesible on js side like this

//loading binary
const result = await WebAssembly.instatiate(binary);
//getting memory.buffer
result.exports.memory.buffer

Is there a plan for support this behaviour? Or do you have any guidance how can I add it? Thanks in advance :)

@cawfree
Copy link
Owner

cawfree commented May 2, 2023

Hey @Faliszek, thanks!

You're correct, this functionality isn't implemented yet, but it would be very nice to have. Thanks for sharing!

I'll need to have a little think about how to implement something like this, but it should be possible.

@Faliszek
Copy link
Author

Faliszek commented May 3, 2023

Let me know if it's there anything I can help with. Once again thanks for all your work, this library is a game changer for me.

@cawfree
Copy link
Owner

cawfree commented May 10, 2023

This functionality has been implemented as published as version 0.3.3. (Instructions)

Thank you for your patience whilst this was being implemented.

If you have any trouble with this feature or notice any other aspects of the specification that are missing, please feel free to raise another issue!

#10

@cawfree cawfree closed this as completed May 10, 2023
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

2 participants