In the exports, we generate
public interface ITest {
static abstract void EmptyListParam(byte[] a);
}
but we probably generate
public interface ITest {
static abstract void EmptyListParam(ReadOnlySpan<byte> a)
}
because we don't expect the callee to modify that memory space.
This would allow us to pass the host buffer, instead of making a managed copy on the heap (and GC it later).
Note they could always make copy themself.
public static void EmptyListParam(ReadOnlySpan<byte> a) {
byte[] copy = a.ToArray();
}
Originally posted by @pavelsavara in #1138 (comment)