Open badcel opened 2 years ago
I second this. I already know of a project that could benefit from this feature
https://github.com/PintaProject/Pinta
Pinta often uses byte arrays for image operations. Generated methods in the C# bindings of several libraries that are used by the project only accept regular C# arrays that are allocated on the heap. By accepting Span<>
and ReadOnlySpan<>
we would be able to allocate more things on the stack, improving efficiency.
Span / ReadOnlySpan can potentially improve runtime behaviour as it avoids memory allocations.
Is there any documentation explaining benefits and / or common use cases?