Why passing ref struct to methods actually passes a copy of a ref struct?
When I’m trying to pass a ref struct that looks like, say public ref struct BufferWriter { readonly Buffer* _pb; public int WrittenBytes; //… public bool Append(ReadOnlySpan<byte> buffer) { //… WrittenBytes += buffer.Length; //… } } to a method (Write100U8Chars(BufferWriter, Object) in the following example), a struct is not actually passed by a reference, but… Read More Why passing ref struct to methods actually passes a copy of a ref struct?