Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConvertToNative()

static unsafe void System.StubHelpers.FixedWSTRMarshaler.ConvertToNative ( string strManaged,
IntPtr nativeHome,
int length )
inlinestaticpackage

Definition at line 5 of file FixedWSTRMarshaler.cs.

6 {
7 ReadOnlySpan<char> readOnlySpan = strManaged;
8 Span<char> destination = new Span<char>((void*)nativeHome, length);
9 int num = Math.Min(readOnlySpan.Length, length - 1);
10 readOnlySpan.Slice(0, num).CopyTo(destination);
11 destination[num] = '\0';
12 }

References System.destination, System.length, System.ReadOnlySpan< T >.Length, System.Math.Min(), and System.ReadOnlySpan< T >.Slice().