Closed
Description
Right now, we have to allocate a buffer using malloc, and then copy TypedData to the buffer element by element. This adds a lot of overhead, and makes the ffi calls slow for larger buffers. So it will be great if we can get a pointer to TypedData, and use that in ffi calls.
We can have a version of malloc that takes a TypedData, instead of size, and then allocates the TypedData buffer in native memory. Then we can add a method to TypedData called .toNative()
on top of that.