You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm missing something, but is there any way to take a typed array (say, UInt8Array) and turn it into a &[u8], or the equivalent? I found issue #5 but that was a very long time ago and I'm not sure if its still applicable.
In my use case I load a large image as an ArrayBuffer from an HTTP request, convert it into a UInt8Array and pass that to the WASM. Inside the WASM is a function that takes a &[u8] and it would be convinient, and more efficient, to be able to take a reference to the UInt8Array rather than first allocate an enourmous vector, then take a slice of that.
The text was updated successfully, but these errors were encountered:
Summary
Maybe I'm missing something, but is there any way to take a typed array (say, UInt8Array) and turn it into a
&[u8]
, or the equivalent? I found issue #5 but that was a very long time ago and I'm not sure if its still applicable.In my use case I load a large image as an
ArrayBuffer
from an HTTP request, convert it into aUInt8Array
and pass that to the WASM. Inside the WASM is a function that takes a&[u8]
and it would be convinient, and more efficient, to be able to take a reference to theUInt8Array
rather than first allocate an enourmous vector, then take a slice of that.The text was updated successfully, but these errors were encountered: