-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c#: Use Spans instead of e.g. byte[] #1080
Comments
#1138 address using
I think the intent of the comment is that we would have a functions like: input.Read(buffer.AsSpan());
// use buffer that was filed The streams wit looks like
We could return a Span here but I don't know how we detect that we should re-write the |
I think the intent is that we will use buffer provided by the caller. And that the generated C# proxy would allow that to maximal possible extent. Perhaps even passing that buffer to the host where appropriate. |
The hang up for me here is how do translate the WIT:
Into a function, that we could pass a buffer so that it can be filled, ie Other than the specific wasi interface name there aren't any real heuristics to know that a function signature of I am going to propose to not worry about his for now, since the API will change with WASI 0.3 and there is also discussions around a FillableArray type in 0.3.x that would solve this problem. |
Use Spans in wit-bindgen-generated code to minimize copies (example while using streams)
The text was updated successfully, but these errors were encountered: