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

Write IPC stream directly to a Uint8Array rather than a vector? #133

Closed
kylebarron opened this issue Jun 9, 2022 · 1 comment
Closed

Comments

@kylebarron
Copy link
Owner

Is it not possible to write the IPC stream directly to a Uint8Array rather than a vector? Not super familiar with rust/wasm at all but was going to look into this tomorrow. Just wanted to check if there was some reason you hadn't first.

Originally posted by @akash329d in #15 (comment)

@kylebarron kylebarron mentioned this issue Jun 9, 2022
@kylebarron
Copy link
Owner Author

The current implementation was done because it seemed to work reliably. I think in general it's not possible to write the IPC stream directly into a Uint8Array because the Uint8Array is memory managed by JS (outside WASM) while the Vec<u8> is memory managed by Rust (inside WASM).

It's possible this could be improved with reference types, see #69 and https://rustwasm.github.io/wasm-bindgen/reference/reference-types.html

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