Skip to content

What is safety consern about Uint32Array::view exactly? #3802

Answered by Liamolucko
Maximkaaa asked this question in Q&A
Discussion options

You must be logged in to vote

The problem is that Box::new might cause Wasm memory to get bigger, and when it does that all the existing references in JS get replaced with empty Uint8Arrays ('detached').

See https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory/grow#detachment_upon_growing (that's talking about Memory.grow in JavaScript, when it's the memory.grow instruction that gets used by Box, but it works the same way).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Maximkaaa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants