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
Allocate it's structure in memory space, then pass the address of that memory to the function. This is basically how pointers or references work in other languages.
Alternatively, use separate parameters for each component of that object and reconstruct it within the function. This is how .NET passes structs to functions.
Maybe this has been answered somewhere else, so sorry if asking again.
Does this mean that there is no way to pass data without doing a full copy?
With Pinvoke we can send Pinned pointers. Is there anything like that?
If not is there some way that you could define the Memory Space so it has access to shared memory some way?
Maybe with https://docs.microsoft.com/en-us/dotnet/api/system.buffers.memorymanager-1?view=net-5.0
I'm really interested in an effectively zero copy path to calling functions that can manipulate, or return objects (by pointer is fine)
You can do that by importing memory. The provider of that memory can hold on to the reference and directly access any of its contents even after the WASM has started operating. Managing memory shared inside and outside of WASM requires care, but enables zero-copy paths that use pointers.
No description provided.
The text was updated successfully, but these errors were encountered: