We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7675121 commit 9d4534dCopy full SHA for 9d4534d
net/FlatBuffers/Table.cs
@@ -150,7 +150,9 @@ public T[] __vector_as_array<T>(int offset)
150
151
var pos = this.__vector(o);
152
var len = this.__vector_len(o);
153
- return bb.ToArray<T>(pos, len);
+ // Fix memory alignment issue: calculate correct byte length (element count × element size)
154
+ var byteLen = len * System.Runtime.InteropServices.Marshal.SizeOf<T>();
155
+ return bb.ToArray<T>(pos, byteLen);
156
}
157
158
// Initialize any Table-derived type to point to the union at the given offset.
0 commit comments