-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Description
UnsafeTypedArray takes &[T] in the constructor, and stores that internally. It's nice for reading values efficiently, but as I understand it rustc will assume that values behind a reference are never mutated, and thus it's unsound to mutate values using an UnsafeTypedArray.
Could a similar structure be made which exposes a mutable view of an array to JS? For manual initialization code, like
let mut arr = [0u32; 3];
let mut wrapped = MutableUnsafeTypedArray::new(&mut arr);
js! {
let vals = @{wrapped};
vals[0] = ...;
vals[1] = ...;
vals[2] = ...;
};
arrMetadata
Metadata
Assignees
Labels
No labels